00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00089
00090
00091 #include <fstream>
00092 #include <iostream>
00093 #include <sys/types.h>
00094 #include <sys/stat.h>
00095 #include <unistd.h>
00096
00097 #include "TClonesArray.h"
00098 #include "TSystem.h"
00099
00100 #include "Mad/MadNsID.h"
00101 #include "Mad/MadQuantities.h"
00102
00103 MadNsID::MadNsID() : weights_read(false), weight_fname("") {
00104 cache_det=Detector::kUnknown;
00105 cache_beam=BeamType::kUnknown;
00106 cache_fid = -1;
00107 cache_prior = -1;
00108
00109 }
00110
00111 bool MadNsID::ReadWeights(const char* file){
00112
00113
00114
00115 weights_read = false;
00116
00117 std::ifstream weightfile(file);
00118 if(!weightfile){
00119 std::cout<<"MadNsID::ReadWeights(), cannot read: "<<file<<std::endl;
00120 return false;
00121 }
00122 std::cout<<"Reading MadNsID weights from: "<<file<<std::endl;
00123
00124 Int_t all = inneuron*hidneuron+hidneuron+hidneuron+1;
00125 Int_t all1 = inneuron*hidneuron+hidneuron;
00126 Int_t n1 =0;
00127 Int_t nw1 =0;
00128 Int_t no =0;
00129 Int_t nwo =0;
00130
00131
00132 for(Int_t k=0;k<all;k++){
00133 Double_t var;
00134 weightfile >> var ;
00135 if(!weightfile.good()){
00136 std::cerr<<"MadNsID::ReadWeights() bad input, k="<<k<<std::endl;
00137 weightfile.close();
00138 return false;
00139 }
00140 if(k<all1){
00141 if(k%(inneuron+1)==0){
00142 nw1=0;
00143 constant1[n1]=var;
00144 n1=n1+1;
00145 }
00146 else {
00147 weight1[nw1][n1-1]=var;
00148 nw1=nw1+1;
00149 }
00150 }
00151 else if(k>=all1){
00152 if((k-all1)%(hidneuron+1)==0){
00153 nwo=0;
00154 constanto[no]=var;
00155 no=no+1;
00156 }
00157 else {
00158 weighto[nwo]=var;
00159 nwo=nwo+1;
00160 }
00161 }
00162 }
00163
00164 weightfile.close();
00165 weights_read=true;
00166 return true;
00167
00168 }
00169
00170
00171 Double_t MadNsID::CalcPID(const AnnInputBlock& anninput,
00172 const Detector::Detector_t& det){
00173
00174
00175 if(!weights_read) assert( ReadWeights(weight_fname.c_str()) );
00176
00177 Double_t rin[hidneuron];
00178 Double_t out[hidneuron];
00179 for(Int_t i=0; i<hidneuron; i++){rin[i]=0; out[i]=0;}
00180
00181
00182 if(det==Detector::kFar){
00183
00184 out[0] = (anninput.aTrkphperpl*anninput.aTotrk*anninput.aTrkpass)/2000.;
00185 out[1] = (anninput.aPhperpl/10000.);
00186
00187 out[2] = (anninput.aTotlen/40);
00188 out[3] = (anninput.aPh3/(anninput.aTotph+1.));
00189 out[4] = (anninput.aPh6/(anninput.aTotph+1.));
00190 out[5] = (anninput.aPhlast/(anninput.aTotph+1.));
00191 out[6] = ((anninput.aTrkplu-anninput.aShwplu)+20.)/40.;
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203 }
00204 else if(det==Detector::kNear){
00205 out[0] = (anninput.aTrkphperpl*anninput.aTotrk*anninput.aTrkpass)/5000.;
00206 out[1] = (anninput.aPhperpl/10000.);
00207
00208 out[2] = (anninput.aTotlen/40);
00209 out[3] = (anninput.aPh3/(anninput.aTotph+1.));
00210 out[4] = (anninput.aPh6/(anninput.aTotph+1.));
00211 out[5] = (anninput.aPhlast/(anninput.aTotph+1.));
00212 out[6] = ((anninput.aTrkplu-anninput.aShwplu)+10.)/20.;
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224 }
00225
00226
00227
00228
00229
00230
00231
00232
00233 for(Int_t i=0;i<hidneuron;i++){
00234 rin[i]=constant1[i];
00235 for(Int_t j=0;j<inneuron;j++){
00236 rin[i]=rin[i]+weight1[j][i]*out[j];
00237 }
00238 }
00239
00240 for(Int_t i=0;i<hidneuron;i++){
00241 out[i]=Sigmoid(rin[i]);
00242 }
00243
00244 Double_t prob =constanto[0];
00245 for(Int_t i=0;i<hidneuron;i++) prob=prob+weighto[i]*out[i];
00246
00247
00248 if(anninput.aTotlen>50) prob=0.;
00249
00250 return prob;
00251
00252 }
00253
00254 bool MadNsID::CalcVars(MadQuantities* mq, Int_t event,
00255 AnnInputBlock& anninput){
00256
00257
00258
00259
00260
00261
00262 anninput.aTotrk =0.;
00263 anninput.aTotstp =0.;
00264 anninput.aTotph =0.;
00265 anninput.aTotlen =0.;
00266 anninput.aPhperpl =0.;
00267 anninput.aPhperstp =0.;
00268
00269
00270 anninput.aTrkpass =0.;
00271 anninput.aTrkph =0.;
00272 anninput.aTrklen =0.;
00273 anninput.aTrkphperpl =0.;
00274 anninput.aTrkphper =0.;
00275 anninput.aTrkplu =0.;
00276 anninput.aTrkplv =0.;
00277 anninput.aTrkstp =0.;
00278
00279 anninput.aShwph =0.;
00280 anninput.aShwstp =0.;
00281 anninput.aShwdig =0.;
00282 anninput.aShwpl =0.;
00283 anninput.aShwphper =0.;
00284 anninput.aShwphperpl =0.;
00285 anninput.aShwphperdig =0.;
00286 anninput.aShwphperstp =0.;
00287 anninput.aShwplu =0.;
00288 anninput.aShwplv =0.;
00289 anninput.aPh3 =0.;
00290 anninput.aPh6 =0.;
00291 anninput.aPhlast =0.;
00292 anninput.aPhcommon =0.;
00293
00294
00295
00296
00297 const NtpSREvent* ntpEvent = mq->GetEvent(event) ;
00298 if(!ntpEvent) return false;
00299 int track_index = -1;
00300 const NtpSRTrack* ntpTrack = mq->GetLargestTrackFromEvent(event,track_index);
00301 int shower_index = -1;
00302 const NtpSRShower* ntpShower = mq->GetLargestShowerFromEvent(event,shower_index);
00303
00304 anninput.aTotrk =ntpEvent->ntrack;
00305 anninput.aTotstp =ntpEvent->nstrip;
00306 anninput.aTotph =ntpEvent->ph.sigcor;
00307 anninput.aTotlen =ntpEvent->plane.end-ntpEvent->plane.beg+1;
00308 anninput.aPhperpl =ntpEvent->ph.sigcor/ntpEvent->plane.n;
00309 anninput.aPhperstp =ntpEvent->ph.sigcor/ntpEvent->nstrip;
00310
00311 if(track_index!=-1) {
00312 anninput.aTrkpass =ntpTrack->fit.pass;
00313 anninput.aTrkph =ntpTrack->ph.sigcor;
00314 anninput.aTrklen =ntpTrack->plane.ntrklike;
00315 if(ntpTrack->plane.ntrklike>0) anninput.aTrkphperpl =ntpTrack->ph.sigcor/ntpTrack->plane.ntrklike;
00316 if(ntpEvent->ph.sigcor>0) anninput.aTrkphper =ntpTrack->ph.sigcor/ntpEvent->ph.sigcor;
00317 anninput.aTrkplu =ntpTrack->plane.nu;
00318 anninput.aTrkplv =ntpTrack->plane.nv;
00319 anninput.aTrkstp =ntpTrack->nstrip;
00320 }
00321 if(shower_index!=-1) {
00322 anninput.aShwph =ntpShower->ph.sigcor;
00323 anninput.aShwstp =ntpShower->nstrip;
00324 anninput.aShwdig =ntpShower->ndigit;
00325 anninput.aShwpl =ntpShower->plane.n;
00326 anninput.aShwphper =ntpShower->ph.sigcor/ntpEvent->ph.sigcor;
00327 anninput.aShwphperpl =ntpShower->ph.sigcor/ntpShower->plane.n;
00328 anninput.aShwphperdig =ntpShower->ph.sigcor/ntpShower->ndigit;
00329 anninput.aShwphperstp =ntpShower->ph.sigcor/ntpShower->nstrip;
00330 anninput.aShwplu =ntpShower->plane.nu;
00331 anninput.aShwplv =ntpShower->plane.nv;
00332 }
00333
00334 Int_t ssind,ssplind;
00335 Double_t ssphtot;
00336 Bool_t foundshw,foundtrk;
00337 Int_t planes=ntpEvent->plane.beg;
00338
00339 Double_t ph3,ph6,phlast,phcommon,phnowere,hitcommon,hitnowere;
00340 ph3=0.;ph6=0.;phlast=0.;phcommon=0.;phnowere=0.;hitcommon=0.;hitnowere=0.;
00341
00342 for(Int_t evss=0;evss<ntpEvent->nstrip;evss++){
00343 Int_t stp_index=((ntpEvent->stp)[evss]);
00344
00345 if(stp_index!=-1){
00346
00347 const NtpSRStrip* ntpStrip = mq->GetStrip(stp_index);
00348 if(!ntpStrip) continue;
00349 ssind =ntpStrip->strip;
00350 ssplind =ntpStrip->plane;
00351 ssphtot =ntpStrip->ph1.sigcor+ntpStrip->ph0.sigcor;
00352
00353 foundshw=false;
00354 foundtrk=false;
00355
00356 Double_t phstrips=0;
00357 Double_t phstript=0;
00358
00359 Int_t sshwind,sshwplind;
00360 Double_t sshwphtot;
00361
00362 if(shower_index!=-1) {
00363 for(Int_t jj=0;jj<ntpShower->nstrip;jj++){
00364 Int_t stp_indexs=((ntpShower->stp)[jj]);
00365
00366 if(stp_indexs!=-1){
00367
00368 ntpStrip = mq->GetStrip(stp_indexs);
00369 if(!foundshw){
00370 sshwind=ntpStrip->strip;
00371 sshwplind=ntpStrip->plane;
00372 sshwphtot=ntpStrip->ph1.sigcor+ntpStrip->ph0.sigcor;
00373 if(sshwind==ssind && sshwplind==ssplind) {
00374 foundshw=true;
00375 phstrips=sshwphtot;
00376 }
00377 }
00378 }
00379 }
00380 }
00381
00382 Int_t strkind,strkplind;
00383 Double_t strkphtot;
00384 if(track_index!=-1) {
00385 for(Int_t jj=0;jj<ntpTrack->nstrip;jj++){
00386 Int_t stp_indext=((ntpTrack->stp)[jj]);
00387
00388 if(stp_indext!=-1){
00389
00390 ntpStrip = mq->GetStrip(stp_indext);
00391
00392 if(!foundtrk){
00393 strkind =ntpStrip->strip;
00394 strkplind=ntpStrip->plane;
00395 strkphtot=ntpStrip->ph1.sigcor+ntpStrip->ph0.sigcor;
00396 if(strkind==ssind && strkplind==ssplind) {
00397 foundtrk=true;
00398 phstript=strkphtot;
00399 }
00400 }
00401
00402 }
00403 }
00404 }
00405
00406 if(foundshw && foundtrk) {
00407 hitcommon=hitcommon+1;
00408 phcommon=phcommon+phstrips+phstript;
00409 }
00410 if(!foundshw && ! foundtrk) {
00411 hitnowere=hitnowere+1;
00412 phnowere=phnowere+ssphtot;
00413 }
00414 if(ssplind>=planes && ssplind<=(planes+3)){
00415 ph3=ph3+ssphtot;
00416 }
00417 else if(ssplind>(planes+3) && ssplind<=(planes+6)){
00418 ph6=ph6+ssphtot;
00419 }
00420 else {
00421 phlast=phlast+ssphtot;
00422 }
00423
00424 }
00425
00426 }
00427
00428
00429 anninput.aPh3 =ph3;
00430 anninput.aPh6 =ph6;
00431 anninput.aPhlast =phlast;
00432 anninput.aPhcommon =phcommon;
00433
00434 return true;
00435
00436
00437 }
00438
00439 bool MadNsID::CalcVars(NtpSREvent* ntpEvent, NtpSRTrack *ntpTrack,
00440 NtpSRShower *ntpShower, NtpStRecord* st,
00441 AnnInputBlock& anninput)
00442 {
00443
00444
00445
00446
00447
00448 anninput.aTotrk =0.;
00449 anninput.aTotstp =0.;
00450 anninput.aTotph =0.;
00451 anninput.aTotlen =0.;
00452 anninput.aPhperpl =0.;
00453 anninput.aPhperstp =0.;
00454
00455 anninput.aTrkpass =0.;
00456 anninput.aTrkph =0.;
00457 anninput.aTrklen =0.;
00458 anninput.aTrkphperpl =0.;
00459 anninput.aTrkphper =0.;
00460 anninput.aTrkplu =0.;
00461 anninput.aTrkplv =0.;
00462 anninput.aTrkstp =0.;
00463
00464 anninput.aShwph =0.;
00465 anninput.aShwstp =0.;
00466 anninput.aShwdig =0.;
00467 anninput.aShwpl =0.;
00468 anninput.aShwphper =0.;
00469 anninput.aShwphperpl =0.;
00470 anninput.aShwphperdig =0.;
00471 anninput.aShwphperstp =0.;
00472 anninput.aShwplu =0.;
00473 anninput.aShwplv =0.;
00474
00475 anninput.aPh3 =0.;
00476 anninput.aPh6 =0.;
00477 anninput.aPhlast =0.;
00478 anninput.aPhcommon =0.;
00479
00480
00481
00482 if(!ntpEvent) return false;
00483
00484 anninput.aTotrk =ntpEvent->ntrack;
00485 anninput.aTotstp =ntpEvent->nstrip;
00486 anninput.aTotph =ntpEvent->ph.sigcor;
00487 anninput.aTotlen =ntpEvent->plane.end-ntpEvent->plane.beg+1;
00488 anninput.aPhperpl =ntpEvent->ph.sigcor/ntpEvent->plane.n;
00489 anninput.aPhperstp =ntpEvent->ph.sigcor/ntpEvent->nstrip;
00490
00491 if(ntpTrack != 0) {
00492 anninput.aTrkpass =ntpTrack->fit.pass;
00493 anninput.aTrkph =ntpTrack->ph.sigcor;
00494 anninput.aTrklen =ntpTrack->plane.ntrklike;
00495 if(ntpTrack->plane.ntrklike>0) anninput.aTrkphperpl =ntpTrack->ph.sigcor/ntpTrack->plane.ntrklike;
00496 if(ntpEvent->ph.sigcor>0) anninput.aTrkphper =ntpTrack->ph.sigcor/ntpEvent->ph.sigcor;
00497 anninput.aTrkplu =ntpTrack->plane.nu;
00498 anninput.aTrkplv =ntpTrack->plane.nv;
00499 anninput.aTrkstp =ntpTrack->nstrip;
00500 }
00501 if(ntpShower != 0) {
00502 anninput.aShwph =ntpShower->ph.sigcor;
00503 anninput.aShwstp =ntpShower->nstrip;
00504 anninput.aShwdig =ntpShower->ndigit;
00505 anninput.aShwpl =ntpShower->plane.n;
00506 anninput.aShwphper =ntpShower->ph.sigcor/ntpEvent->ph.sigcor;
00507 anninput.aShwphperpl =ntpShower->ph.sigcor/ntpShower->plane.n;
00508 anninput.aShwphperdig =ntpShower->ph.sigcor/ntpShower->ndigit;
00509 anninput.aShwphperstp =ntpShower->ph.sigcor/ntpShower->nstrip;
00510 anninput.aShwplu =ntpShower->plane.nu;
00511 anninput.aShwplv =ntpShower->plane.nv;
00512 }
00513
00514 Int_t ssind,ssplind;
00515 Double_t ssphtot;
00516 Bool_t foundshw,foundtrk;
00517 Int_t planes =ntpEvent->plane.beg;
00518 Double_t ph3,ph6,phlast,phcommon,phnowere,hitcommon,hitnowere;
00519 ph3=0.;ph6=0.;phlast=0.;phcommon=0.;phnowere=0.;hitcommon=0.;hitnowere=0.;
00520
00521
00522 for(Int_t i = 0; i < ntpEvent->nstrip;i++)
00523 {
00524 Int_t stp_index=((ntpEvent->stp)[i]);
00525
00526 if(stp_index!=-1){
00527
00528 NtpSRStrip* ntpStrip = dynamic_cast<NtpSRStrip *>((*st->stp)[stp_index]);
00529
00530
00531 ssind = ntpStrip->strip;
00532 ssplind = ntpStrip->plane;
00533 ssphtot = ntpStrip->ph1.sigcor+ntpStrip->ph0.sigcor;
00534
00535 foundshw=false;
00536 foundtrk=false;
00537
00538 Double_t phstrips=0;
00539 Double_t phstript=0;
00540
00541 Int_t sshwind,sshwplind;
00542 Double_t sshwphtot;
00543
00544 if(ntpShower != 0) {
00545 for(Int_t jj=0;jj<ntpShower->nstrip;jj++){
00546 Int_t stp_indexs=((ntpShower->stp)[jj]);
00547
00548 if(stp_indexs!=-1){
00549
00550 ntpStrip = dynamic_cast<NtpSRStrip *>((*st->stp)[stp_indexs]);
00551
00552 if(!foundshw){
00553 sshwind=ntpStrip->strip;
00554 sshwplind=ntpStrip->plane;
00555 sshwphtot=ntpStrip->ph1.sigcor+ntpStrip->ph0.sigcor;
00556 if(sshwind==ssind && sshwplind==ssplind) {
00557 foundshw=true;
00558 phstrips=sshwphtot;
00559 }
00560 }
00561 }
00562 }
00563 }
00564
00565 Int_t strkind,strkplind;
00566 Double_t strkphtot;
00567 if(ntpTrack != 0) {
00568 for(Int_t jj=0;jj<ntpTrack->nstrip;jj++){
00569 Int_t stp_indext=((ntpTrack->stp)[jj]);
00570
00571 if(stp_indext!=-1){
00572
00573 ntpStrip = dynamic_cast<NtpSRStrip *>((*st->stp)[stp_indext]);
00574
00575 if(!foundtrk){
00576 strkind=ntpStrip->strip;
00577 strkplind=ntpStrip->plane;
00578 strkphtot=ntpStrip->ph1.sigcor+ntpStrip->ph0.sigcor;
00579 if(strkind==ssind && strkplind==ssplind) {
00580 foundtrk=true;
00581 phstript=strkphtot;
00582 }
00583 }
00584 }
00585 }
00586 }
00587
00588 if(foundshw && foundtrk) {
00589 hitcommon=hitcommon+1;
00590 phcommon=phcommon+phstrips+phstript;
00591 }
00592 if(!foundshw && ! foundtrk) {
00593 hitnowere=hitnowere+1;
00594 phnowere=phnowere+ssphtot;
00595 }
00596 if(ssplind>=planes && ssplind<=(planes+3)){
00597 ph3=ph3+ssphtot;
00598 }
00599 else if(ssplind>(planes+3) && ssplind<=(planes+6)){
00600 ph6=ph6+ssphtot;
00601 }
00602 else {
00603 phlast=phlast+ssphtot;
00604 }
00605 }
00606 }
00607
00608 anninput.aPh3 =ph3;
00609 anninput.aPh6 =ph6;
00610 anninput.aPhlast =phlast;
00611 anninput.aPhcommon =phcommon;
00612
00613 return true;
00614 }
00615
00616 std::string MadNsID::GetWeightFileName(const Detector::Detector_t& det,
00617 const BeamType::BeamType_t& beam,
00618 Int_t fid, Int_t prior)
00619 {
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636 std::string priv="";
00637 std::string pub="";
00638
00639 std::string base="";
00640
00641 priv=getenv("SRT_PRIVATE_CONTEXT");
00642 pub = getenv("SRT_PUBLIC_CONTEXT");
00643
00644 if(priv == "" && pub == ""){
00645 std::cerr<<"No SRT_PUBLIC_CONTEXT set"<<std::endl;
00646 assert(false);
00647 }
00648
00649 priv += "/Mad/data/";
00650 pub += "/Mad/data/";
00651
00652 struct stat ss;
00653 if(stat(priv.c_str(), &ss) == -1) {
00654 std::cout<<"Data not present in SRT_PRIVATE_CONTEXT trying SRT_PUBLIC"<<std::endl;
00655 if(stat(pub.c_str(), &ss) == -1) {
00656 std::cout<<"Data not present in SRT_PUBLIC - doesn't seem to exist"<<std::endl;
00657 assert(false);
00658 }else{ base = pub; }
00659 }else { base = priv; }
00660
00661 if(det==Detector::kFar){
00662 if(prior==1){
00663 if(fid==1) base+="weights_farle_cedar_daikon7v2.dat";
00664 if(fid==2) base+="weights_farle_cedar_daikon7v2.dat";
00665 }
00666 if(prior==2){
00667 if(fid==1) base+="weights_farle_cedar_daikon7v2.dat";
00668 if(fid==2) base+="weights_farle_cedar_daikon7v2.dat";
00669 }
00670 if(prior==3){
00671 if(fid==1) base+="weights_farle_cedar_daikon7v2.dat";
00672 if(fid==2) base+="weights_farle_cedar_daikon7v2.dat";
00673 }
00674 }
00675 else if(det==Detector::kNear){
00676 if(beam==BeamType::kL010z185i || beam==BeamType::kL000z200i || beam==BeamType::kL010z170i || beam==BeamType::kL010z200i) base+="weights_nearle_cedar_daikon7v2.dat";
00677 if(beam==BeamType::k100) base+="weights_nearpme_cedar_daikon7v2.dat";
00678 if(beam==BeamType::k250) base+="weights_nearphe_cedar_daikon7v2.dat";
00679 }
00680
00681 if(stat(base.c_str(),&ss) == -1) {
00682 std::cerr<<"The file '"<<base<<"' doesn't seem to exist"<<std::endl;
00683 assert(false);
00684 }
00685
00686 return base;
00687 }
00688
00689 bool MadNsID::ChooseWeightFile(const Detector::Detector_t& det,
00690 const BeamType::BeamType_t& beam,
00691 Int_t fid, Int_t prior){
00692
00693
00694
00695 if(det==cache_det && beam==cache_beam &&
00696 prior==cache_prior && fid==cache_fid){
00697
00698 return true;
00699 }
00700
00701 weight_fname = GetWeightFileName(det,beam,fid,prior);
00702
00703 Long_t id,size,flags,modtime;
00704 if(gSystem->GetPathInfo(weight_fname.c_str(),&id,&size,&flags,&modtime) == 1) {
00705 return false;
00706 }
00707
00708 if(flags>1) return false;
00709 else {
00710 cache_det=det; cache_beam=beam; cache_prior=prior; cache_fid=fid;
00711 weights_read=false;
00712 return true;
00713 }
00714 }
00715
00716 void MadNsID::SetWeightFile(const char* file){
00717 weight_fname = file;
00718 }
00719
00720 bool MadNsID::GetPID(MadQuantities* mq, Int_t event,
00721 const Detector::Detector_t & det, Double_t& pid){
00722 AnnInputBlock ib;
00723 bool result=true;
00724 result = CalcVars(mq, event, ib);
00725 if(result) pid = CalcPID(ib,det);
00726 return result;
00727 }
00728
00729 bool MadNsID::GetPID(NtpSREvent* ntpEvent, NtpSRTrack *ntpTrack,
00730 NtpSRShower *ntpShower, NtpStRecord* st,
00731 const Detector::Detector_t& det, Double_t& pid)
00732 {
00733 AnnInputBlock ib;
00734 bool result=true;
00735 result = CalcVars(ntpEvent, ntpTrack, ntpShower, st, ib);
00736 if(result) pid = CalcPID(ib,det);
00737 return result;
00738 }
00739
00740 bool MadNsID::CompareAnnBlocks(MadQuantities* mq, Int_t event, const AnnInputBlock& ext){
00741 AnnInputBlock ib;
00742 CalcVars(mq, event, ib);
00743 if( !(ib==ext) ){
00744 std::cout<<"AnnInputBlocks disagree!!!"<<std::endl;
00745 std::cout<<"Event: "<<event<<std::endl;
00746 std::cout<<"This block: "<<std::endl;
00747 std::cout<<ib<<std::endl;
00748 std::cout<<"Other block: "<<std::endl;
00749 std::cout<<ext<<std::endl;
00750 return false;
00751 }
00752 else return true;
00753 }