FairRoot/PandaRoot
PndAnalysis.cxx
Go to the documentation of this file.
1 // PndAnalysis
2 // Needs a FairRunAna set up in the macro for file & parameter I/O
3 
4 #include "PndAnalysis.h"
5 
6 #include <string>
7 #include <iostream>
8 #include <iomanip>
9 
10 using std::cout;
11 using std::endl;
12 
13 //Root stuff
14 #include "TTree.h"
15 #include "TChain.h"
16 #include "TClonesArray.h"
17 #include "TParticle.h"
18 #include "TDatabasePDG.h"
19 #include "TParticlePDG.h"
20 
22 #include "PndPidCandidate.h"
23 
24 //RHO stuff
25 #include "RhoFactory.h"
26 #include "RhoCandidate.h"
27 #include "RhoCandList.h"
28 #include "RhoPdtLoader.h"
29 
30 #include "FairTrackParP.h"
31 #include "FairTrackParH.h"
32 #include "FairGeanePro.h"
33 //#include "FairRunAna.h"
34 #include "FairField.h"
35 
36 #include "PndTrack.h"
37 #include "PndPidCandidate.h"
38 #include "PndPidProbability.h"
39 #include "PndAnaPidSelector.h"
40 #include "PndAnaPidCombiner.h"
41 #include "PndMCTrack.h"
42 //#include "PndAnaCovTool.h" // using a cov matrix tool
43 #include "RhoCalculationTools.h"
45 
47 
48 PndAnalysis::PndAnalysis ( TString tname1, TString tname2, TString algnamec, TString algnamen ) :
49  fRootManager ( FairRootManager::Instance() ),
50  fPidSelector ( 0 ),
51  fEvtCount ( 0 ),
52  fChainEntries ( 0 ),
53  fEventRead ( false ),
54  fBuildMcCands ( false ),
55  fVerbose(0),
56  fPhotosMax(0), fPhotosThresh(0.05),
57  fChargedPidName ( algnamec ),
58  fNeutralPidName ( algnamen ),
59  fTracksName ( tname1 ),
60  fTracksName2 ( tname2 ),
61  fDefaultHypo ( 2 )
62 {
63  if ( 0 == fRootManager ) {
64  std::cout << "-E- PndAnalysis: RootManager not instantiated!" << std::endl;
65  return;
66  }
67 
68  Init();
69 }
70 
72 {
73  if ( 0!=fPidSelector ) {
74  delete fPidSelector;
75  }
76 }
77 
78 TClonesArray* PndAnalysis::ReadTCA ( TString tcaname )
79 {
80  TClonesArray* tca = ( TClonesArray* ) fRootManager->GetObject ( tcaname.Data() );
81  if ( fVerbose>4 && ! tca ) { // the info is printed by the RootManager already.
82  std::cout << "-I- PndAnalysis::ReadTCA(): No "<<tcaname.Data() <<" array found." << std::endl;
83  }
84 
85  return tca;
86 }
87 
89 {
90  Reset();
91  fPidHypoStr[0] = "Electron";
92  fPidHypoStr[1] = "Muon";
93  fPidHypoStr[2] = "Pion";
94  fPidHypoStr[3] = "Kaon";
95  fPidHypoStr[4] = "Proton";
96  fPidHypoStr[5] = "";
97  fHypoPdg[0]=-11;
98  fHypoPdg[1]=-13;
99  fHypoPdg[2]=211;
100  fHypoPdg[3]=321;
101  fHypoPdg[4]=2212;
102  fHypoPdg[5]=0;
103 
104  fNeutralCands = ReadTCA ( "PidNeutralCand" );
105  //if ( !fNeutralCands ) { }
106  //fNeutralProbability = ReadTCA ( fNeutralPidName.Data()+fPidHypoStr[fDefaultHypo] );
107 
108  // List of branches to check by default
109  TString branchnames1[4]= {fTracksName,"SttMvdGemGenTrack","BarrelGenTrack","SttMvdGenTrack"};
110  TString branchnames2[4]= {fTracksName2,"FTSGenTrack","FtsIdealGenTrack","FTSTrkIdeal"};
111  for (int i = 0; i < 6 ; i++) // 0-4 for PID hypothesis, 5 for fallback
112  {
113  //read pidcand arrays
114  fTracks[i]=NULL; // initialize properly
115  fTracks2[i]=NULL; // initialize properly
116  fBremCorr[i]=NULL; // initialize properly
117  fChargedProbability[i]=NULL; // initialize properly
118  fChargedCands[i] = ReadTCA ( "PidChargedCand"+fPidHypoStr[i] );
119  if ( fChargedCands[i] ) {
120  fHypoFlagCharged[i] = true;
121  std::cout<< " #################### read PidChargedCand with special tracking hypothesis: "<<("PidChargedCand"+fPidHypoStr[i]).Data()<<" pointer "<<fChargedCands[i] <<std::endl;
122  } else {
123  fHypoFlagCharged[i] = false;
124  //fChargedCands[i] = ReadTCA ( "PidChargedCand" );
125  std::cout<< " #################### No PidChargedCand with "<<fPidHypoStr[i].Data()<<" tracking hypothesis" <<std::endl;
126  }
127 
128  // Read Bremsstrahling Corrections and PID values
129  if(fHypoFlagCharged[i]) {
130  fBremCorr[i] = ReadTCA( "BremCorrected4Mom"+fPidHypoStr[i] );
132  }
133 
134  // load barrel tracks
135  for(int k=0; k<4; k++) {
136  if(fHypoFlagCharged[i]) {
137  if(fVerbose>4) std::cout << "-I- PndAnalysis::Init(): br:"<<k<<" hyp:"<<i<<" Trying \""<<(branchnames1[k]+fPidHypoStr[i]).Data() <<"\" now.";
138  fTracks[i] = ReadTCA ( branchnames1[k]+fPidHypoStr[i] );
139  }
140  if ( fTracks[i] ) {
141  if(fVerbose>4) std::cout << " Succes reading tracking array \""<<(branchnames1[k]+fPidHypoStr[i]).Data() <<"\" with pointer "<<fTracks[i];
142  break;
143  }
144  }
145  if ( !fTracks[i] ) {
146  std::cout << "-W- PndAnalysis::Init(): No barrel track inpt array." << std::endl;
147  } else {
148  std::cout<<" printing track array:";
149  std::cout<<endl;
150  fTracks[i]->Print();
151  }
152 
153  // load forward tracks
154  for(int k=0; k<4; k++) {
155  if(fHypoFlagCharged[i]) {
156 
157  if(fVerbose>4) std::cout << "-I- PndAnalysis::Init(): Trying \""<<(branchnames2[k]+fPidHypoStr[i]).Data() <<"\" now.";
158  fTracks2[i] = ReadTCA ( branchnames2[k]+fPidHypoStr[i] );
159  }
160  if ( fTracks2[i] ) break;
161  }
162  if ( !fTracks2[i] ) {
163  std::cout << "-W- PndAnalysis::Init(): No forward track inpt array." << std::endl;
164  } else {
165  std::cout<<endl;
166  fTracks2[i]->Print();
167  }
168 
169  } // loop tracking hyp
170 
171  //Check if a list of pions exists. If not, set default hypo to something else
172  if (!fHypoFlagCharged[2]) {
173  if (fHypoFlagCharged[1]) {
174  fDefaultHypo=1;
175  std::cout<<"PndAnalysis::Init(): Default hypothesis is muons."<<std::endl;
176  }
177  else if (fHypoFlagCharged[0]) {
178  fDefaultHypo=0;
179  std::cout<<"PndAnalysis::Init(): Default hypothesis is electrons."<<std::endl;
180  }
181  else if (fHypoFlagCharged[3]) {
182  fDefaultHypo=3;
183  std::cout<<"PndAnalysis::Init(): Default hypothesis is Kaons."<<std::endl;
184  }
185  else if (fHypoFlagCharged[4]) {
186  fDefaultHypo=4;
187  std::cout<<"PndAnalysis::Init(): Default hypothesis is protons."<<std::endl;
188  }
189  else {
190  std::cout<<"PndAnalysis::Init(): No Multikalman input branches exist, do fallback."<<std::endl;
191  fDefaultHypo=5; // empty string in name arrays
192  }
193  } else {
194  std::cout<<"PndAnalysis::Init(): Default hypothesis is pions."<<std::endl;
195  }
196 
197  // -- MC Tracks
198  fBuildMcCands = false;
199 
200  fMcCands = 0;
201 
202  if(fVerbose>4) std::cout << "-I- PndAnalysis::Init(): Trying mc stack now." << std::endl;
203  fMcTracks = ( TClonesArray* ) fRootManager->GetObject ( "MCTrack" );
204 
205  if ( ! fMcTracks && fVerbose ) {
206  std::cout << "-W- PndAnalysis::Init(): No \"MCTrack\" array found. No MC info available." << std::endl;
207  } else {
208  fBuildMcCands = true;
209  fMcCands = new TClonesArray ( "RhoCandidate" );
210  // next line commented by KG, 07/2012
211  fRootManager->Register ( "PndMcTracks","PndMcTracksFolder", fMcCands, kFALSE );
212  }
213 
214  //fChainEntries = ( fRootManager->GetInChain() )->GetEntries();
215  fChainEntries = fRootManager->CheckMaxEventNo();
216 
217  //TODO default constructor here?
220 
221 }
222 
223 
225 {
226  fEvtCount=0;
227 }
228 
230 {
231  // do a safe cleanup
232  for (int i = 0; i<6; i++) {
233  //fAllCandList[i].Cleanup();
234  fChargedCandList[i].Cleanup();
235  }
239 
240 }
241 
242 //void PndAnalysis::ReadCandidates()
243 //{
244 //ReadRecoCandidates();
245 //BuildMcCands();
246 //return;
247 //}
248 
250 {
251  Cleanup();
253  BuildMcCands();
254  return;
255 }
256 
257 Int_t PndAnalysis::GetEvent ( Int_t n )
258 {
259  Cleanup();
260 
261  if ( n>=0 ) {
262  fEvtCount=n+1;
263  } else {
264  fEvtCount++;
265  }
266 
267  if ( fEvtCount>fChainEntries ) {
269  Info("PndAnalysis::GetEvent()","Maximum number of entries in the file chain reached: %i.",fEvtCount);
270  return 0;
271  }
272  fRootManager->ReadEvent ( fEvtCount-1 );
273 
274  //Printout
275  if(fVerbose>4)
276  {
277  std::cout
278  <<"-------->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8"
279  <<"\n"
280  <<" No. - Name - Flag - PidArr - Trk Arr -Trk Arr2 - PID - Brem"
281  <<std::endl;
282  for (int i = 0; i < 6 ; i++) // 0-4 for PID hypothesis, 5 for fallback
283  {
284  std::cout
285  <<std::setw(5)<<i
286  <<std::setw(10)<<fPidHypoStr[i]
287  <<std::setw(10)<<fHypoFlagCharged[i]
288  <<std::setw(10)<<fChargedCands[i]
289  <<std::setw(10)<<fTracks[i]
290  <<std::setw(10)<<fTracks2[i]
291  <<std::setw(10)<<fChargedProbability[i]
292  <<std::setw(10)<<fBremCorr[i]
293  <<std::endl;
294  }
295  std::cout
296  <<"-------->8-------->8-------->8-------->8-------->8-------->8-------->8-------->8"
297  <<std::endl;
298  }
299 
301  BuildMcCands();
302 
303  if(fVerbose) Info("PndAnalysis::GetEvent()","Finished loading event fEvtCount=%i.",fEvtCount);
304  return fEvtCount;
305 }
306 
307 FairMCEventHeader* PndAnalysis::GetEventHeader()
308 {
309  if ( !fEventRead ) {
310  fRootManager->ReadEvent ( fEvtCount-1 );
311  fEventRead=kTRUE;
312  }
313 
314  FairMCEventHeader* evthead = ( FairMCEventHeader* ) FairRootManager::Instance()->GetObject ( "MCEventHeader." );
315 
316  return evthead;
317 }
318 
319 Bool_t PndAnalysis::FillList ( RhoCandList& resultList, TString listkey, TString pidTcaNames, int trackHypothesis )
320 {
321  // Reads the specified List for the current event
322  resultList.Cleanup();
323 
324  // Select the right tracking hypothesis
326  trackHypothesis=fDefaultHypo; // Pions are default
327  }
328 
329  TString trkPostfix[6]= {"Electron","Muon","Pion","Kaon","Proton",""};
330  if(0>trackHypothesis || 6<trackHypothesis) { //only for unsupportet track hyp. mumber
331  for(int i=0; i<6; ++i) {
332  if (fHypoFlagCharged[i] && listkey.Contains ( trkPostfix[i] ) ) {
333  trackHypothesis=i;
334  break;
335  }
336  }
337  }
338  if(fVerbose>4) cout<<"PndAnalysis::FillList() listkey=\""<<listkey<<"\" trackhypo="<<trackHypothesis<<" pidTcaNames=\""<<pidTcaNames.Data()<<"\" trkPostfix=\""<<trkPostfix[trackHypothesis]<<"\""<<endl;
339 
340  // Set which PID information should be used.
341  if ( pidTcaNames!="" ) {
342  fPidCombiner->SetTcaNames ( pidTcaNames, trkPostfix[trackHypothesis] );
343  } else {
344  // FIXME This may cause problems, if defaults are not there
345  fPidCombiner->SetDefaults(); // no pid array
346  }
347 
348  // Get or build Monte-Carlo truth list
349  if ( listkey=="McTruth" ) {
350  return GetMcCandList(resultList);
351  }
352 
353  if(fVerbose>4)Info("PndAnalysis::FillList","key=%s",listkey.Data());
354  // acceleration: just give the large lists directly
355 
356  //if ( listkey=="Neutral" ) {
357  if ( listkey.Contains ( "Neutral" ) ) {
358  resultList=fNeutralCandList;
359  return kTRUE;
360  }
361  //if ( listkey.Contains ( "Neutral" ) )
362  //{ // The neutrals are all clusters, except for the ones which were close to a track. The hypothesis is used in extrapolating the track...
364  //fPidSelector->Select ( fNeutralCandList,resultList );
365  //return kTRUE;
366 
367  //}
368 
369  if ( listkey=="Charged" ) {
370  resultList=fChargedCandList[trackHypothesis];
371  fPidCombiner->Apply ( resultList );
372  if(fVerbose>4)cout<<"trackhyp="<<trackHypothesis<<" list size after selection="<<resultList.GetLength()<<endl;
373  return kTRUE;
374  }
375 
376  const bool doBremCorr = listkey.Contains("Brem");
377  if (doBremCorr) listkey.ReplaceAll("Brem","");
378 
379  // Real selection requested:
380  // set the base list for the PID list maker
381  Bool_t checkcrit = fPidSelector->SetCriterion ( listkey );
382  if (!checkcrit) return kFALSE;
383 
384  if ( listkey.Contains ( "Electron" ) ||listkey.Contains ( "Muon" ) ||listkey.Contains ( "Pion" )
385  || listkey.Contains ( "Kaon" ) ||listkey.Contains ( "Proton" )
386  || listkey.Contains ( "Plus" ) ||listkey.Contains ( "Minus" ) ||listkey.Contains ( "Charged" ) ) {
387  // We create a copy of all charged candidates
388 
389  resultList=fChargedCandList[trackHypothesis];
390  if(fVerbose>4)cout<<"trackhyp="<<trackHypothesis<<" list size="<<resultList.GetLength()<<endl;
391  // Correction for Bremsstrahlung, if desired
392  if ( doBremCorr )
393  {
394  if (fBremCorr[trackHypothesis]==0) {
395  if(fVerbose) Warning("PndAnalysis::FillList","Brem requested but no PndPidBremCorrected4Mom found on input file. Brem Correction can't be done.");
396  } else {
397  for (int j=0; j<resultList.GetLength(); ++j)
398  {
399  int trk_id = resultList[j]->GetTrackNumber();
400  int nBremCorr = fBremCorr[trackHypothesis]->GetEntriesFast();
401  if (nBremCorr!=resultList.GetLength())
402  if(fVerbose)
403  Warning("PndAnalysis::FillList","Warning: BermCorr list size diff. from chargeCandList");
404  PndPidBremCorrected4Mom *bremCorr = (PndPidBremCorrected4Mom*) fBremCorr[trackHypothesis]->At(trk_id);
405  resultList[j]->SetP3(bremCorr->GetMomentum());
406  }
407  }
408  }
409  fPidCombiner->Apply ( resultList );
410  if(fVerbose>4)cout<<"trackhyp="<<trackHypothesis<<" list size after pid ="<<resultList.GetLength()<<endl;
411  resultList.Select(fPidSelector);
412  if(fVerbose>4)cout<<"trackhyp="<<trackHypothesis<<" list size after selection="<<resultList.GetLength()<<endl;
413  return kTRUE;
414  }
415 
416  Error ( "FillList", "Unknown list key: %s",listkey.Data() );
417  return kFALSE;
418 }
419 
421 {
422  l.Clear();
423  // Put all candidates from the mctruth list to the candlist and set the mother-daughter relations
424  if ( !fMcCands ) return kFALSE;
425 
426  RhoCandidate* truth=0;
427  for (int i=0; i<fMcCands->GetEntriesFast(); i++)
428  {
429  // copy candidates via put
430  truth = (RhoCandidate*) fMcCands->At(i);
431  if(fVerbose>4) std::cout<<"PndAnalysis::GetMcCandList: mccand "<<i<<" :"<<truth<<" \t "<<*truth<<std::endl;
432  l.Put(truth);
433  }
434 
435  // now set genealogy inside the list
436  RhoCandidate* truthmother=0;
437  for (int k=0; k<l.GetLength(); k++)
438  {
439  // get mother track
440  PndMCTrack* part = (PndMCTrack*) fMcTracks->At(k);
441  Int_t mcMotherID = part->GetMotherID();
442  if(mcMotherID<0) mcMotherID=part->GetSecondMotherID();
443 
444  // SetMotherLink does the deep mother-daughter relation
445  if (mcMotherID<0) continue; // no mother there, go on...
446  if (mcMotherID>=l.GetLength()) continue; // something bad hapened to the indices
447 
448  // do the linking
449  truthmother = (RhoCandidate*) l[mcMotherID];
450  l[k]->SetMotherLink(truthmother, false);
451  }
452  // And now we have to rapair the charges, because delta electrons are inside the MC list, but not the inons
453  for (int k=0; k<l.GetLength(); k++)
454  {
455  TParticlePDG* ppdg = TDatabasePDG::Instance()->GetParticle(l[k]->PdgCode());
456  double charge=0.0;
457  if ( ppdg ) {
458  charge=ppdg->Charge();
459  } else if (fVerbose) {
460  cout <<"-W- CreateMcCandidate: strange PDG code:"<<l[k]->PdgCode() <<endl;
461  }
462  if ( fabs(charge) >2 ) {
463  charge/=3.;
464  }
465  l[k]->SetCharge(charge);
466  }
467 
468  return kTRUE;
469 }
470 
472 {
473  if ( fRootManager ) {
474  return ( fRootManager->GetInChain() )->GetEntries();
475  } else {
476  return 0;
477  }
478 }
479 
481 {
482  UInt_t _uid=0;
483  for(int i=0; i<6; i++) fChargedCandList[i].Cleanup();
485 
486  // CHARGED
487  int nEntries=0;
488  for(int h=0; h<6; h++) {
489  if ( fChargedCands[h] ) {
490  nEntries=fChargedCands[h]->GetEntriesFast();
491  break;
492  }
493  }
494  if(0==nEntries&&fVerbose) Warning("PndAnalysis::ReadRecoCandidates()","No filled charged reco array found.");
495 
496  for ( Int_t i2=0; i2<nEntries; i2++ )
497  {
498  _uid++; // uid will start from (n_neutrals + 1) should be uniquie over all five pid hypotheses
499  for(int i=0; i<6; i++)
500  {
501  if (!fHypoFlagCharged[i]) continue;
502  PndPidCandidate* mic = ( PndPidCandidate* ) fChargedCands[i]->At ( i2 );
503  RhoCandidate tc ( *mic,_uid );
504  tc.SetTrackNumber ( i2 ); // Index for PID arrays
505  if(i<5){tc.SetType( tc.Charge()*fHypoPdg[i] );}
506  fChargedCandList[i].Add ( &tc );
507  if(fVerbose>4) cout<<"Added Candidate to list i="<<i<<" with i2="<<i2<<" making the list to size "<<fChargedCandList[i].GetLength()<<endl;
508  }
509  }
510 
511  // NEUTRALS
512  if ( fNeutralCands )
513  {
514  for ( Int_t i1=0; i1<fNeutralCands->GetEntriesFast(); i1++ )
515  {
516  _uid++; // uid will start from 1
517  PndPidCandidate* mic = ( PndPidCandidate* ) fNeutralCands->At ( i1 );
518 
519  RhoCandidate tc ( *mic,_uid );
520 
521  tc.SetTrackNumber ( -1 );//(i1);
522  tc.SetType( 22 ); // default PDG code for neutrals is gamma = 22
523  fNeutralCandList.Add(&tc);
524  }
525  } else {
526  if(fVerbose) Warning("PndAnalysis::ReadRecoCandidates()","No neutral reco array found.");
527  }
528 
529  return;
530 }
531 
533 {
534  int i;
535  // Make Monte-carlo truth candidates by the reconstructed particles up to the initial state (if available)
536  if ( !fBuildMcCands ) {
537  if(fVerbose) Info("PndAnalysis::BuildMcCands","No mc to build...");
538  return;
539  }
540  if ( !fMcCands ) {
541  Warning("PndAnalysis::BuildMcCands","No array to store candidates...");
542  return;
543  }
544  if ( fMcCands->GetEntriesFast() != 0 ) {
545  fMcCands->Delete();
546  }
547  if ( fMcTracks == 0 ) {
548  Error ( "BuildMcCands","MC track Array does not exist." );
549  return;
550  }
551 
552  //loop all MCTracks
553  for (i=0; i<fMcTracks->GetEntriesFast(); i++)
554  {
555  // fetch particle properties
556  PndMCTrack* part = (PndMCTrack*) fMcTracks->At(i);
557  TLorentzVector p4 = part->Get4Momentum();
558  TVector3 stvtx = part->GetStartVertex();
559  TParticlePDG* ppdg = TDatabasePDG::Instance()->GetParticle(part->GetPdgCode());
560  double charge=0.0;
561  if ( ppdg ) {
562  charge=ppdg->Charge();
563  } else if (fVerbose) {
564  cout <<"-W- CreateMcCandidate: strange PDG code:"<<part->GetPdgCode() <<endl;
565  }
566  if ( fabs(charge) >2 ) {
567  charge/=3.;
568  }
569  // create mc candidate
570  RhoCandidate* pmc=new ( (*fMcCands)[i] ) RhoCandidate(p4,charge);
571  pmc->SetPos(stvtx);
572  pmc->SetType(part->GetPdgCode()); //this overwrites our generator's mass information
573  pmc->SetP4(p4);
574  pmc->SetTrackNumber(i);
575  pmc->SetLink(FairLink(-1, FairRootManager::Instance()->GetEntryNr(), FairRootManager::Instance()->GetBranchId("MCTrack"), i));
576  }
577 
578  //write correctly assigned copy of mc truth candidates
580 
581  // Assign MC truth to reconstructed allCandnds
582  //todo: make sure that this part is not broken
583  RhoCandidate* truth=0;
584  for(int icand=0; icand<fNeutralCandList.GetLength(); icand++) {
585  RhoCandidate* currentcand=fNeutralCandList.Get(icand);
586  // get reco candidate
587  PndPidCandidate* reco = currentcand->GetRecoCandidate();
588 
589  if(!reco) {
590  if (fVerbose) Info("BuildMcCands","reco object to candidate %i (%p) missing.",icand,currentcand);
591  continue;
592  }
593  // get the mctruth
594  Int_t mcidx = reco->GetMcIndex();
595  if (mcidx>fMcCandList.GetLength() || mcidx<0) continue;
596  truth = fMcCandList[mcidx];
597  currentcand->SetMcTruth(truth);
598  if(fVerbose)Info("PndAnalysis::BuildMcCands()","Now setting truth index %i (%p) to candidate (uid=%i)", mcidx,truth,currentcand->Uid());
599  }
600  for(int ihyp=0; ihyp<6; ihyp++) {
601  for(int icand=0; icand<fChargedCandList[ihyp].GetLength(); icand++) {
602  RhoCandidate* currentcand=fChargedCandList[ihyp].Get(icand);
603  //for(int icand=0;icand<fAllCandList[ihyp].GetLength();icand++){
604  //RhoCandidate* currentcand=fAllCandList[ihyp].Get(icand);
605  // get reco candidate
606 
607  PndPidCandidate* reco = currentcand->GetRecoCandidate();
608 
609  if(!reco) {
610  if (fVerbose) Info("BuildMcCands","reco object to candidate %i (%p) missing.",icand,currentcand);
611  continue;
612  }
613  // get the mctruth
614  Int_t mcidx = reco->GetMcIndex();
615  if (mcidx>fMcCandList.GetLength() || mcidx<0) continue;
616  truth = fMcCandList[mcidx];
617  currentcand->SetMcTruth(truth);
618  if(fVerbose)Info("PndAnalysis::BuildMcCands()","Now setting truth index %i (%p) to candidate (uid=%i)", mcidx,truth,currentcand->Uid());
619  }
620 
621  }
622 }
623 
625 {
626  //Propagate from the tracks first parameter set to the POCA from (0,0,0)
627  TVector3 ip( 0.,0.,0. );
628  return PropagateToPoint ( cand, ip );
629 }
630 
632 {
633  FairTrackParP tStart = GetFirstPar(cand);
634  return Propagator ( 2,tStart,cand );
635 }
636 
638 {
639  //Propagate from the tracks first parameter set to the POCA from mypoint
640  //The candidate is updated but the track not touched
641  //Only the uncorrelated errors are propagated,
642  //TODO: implement a real cov matrix
643  FairTrackParP tStart = GetFirstPar(cand);
644  return Propagator ( 1,tStart,cand,mypoint );
645 }
646 
647 Bool_t PndAnalysis::PropagateToPlane(RhoCandidate* cand, TVector3 origin, TVector3 dj, TVector3 dk)
648 {
649  //Propagate from the tracks first parameter set to a (detector) plane
650  //The candidate is updated but the track not touched
651  //Only the uncorrelated errors are propagated,
652  //TODO: implement a real cov matrix
653  FairTrackParP tStart = GetFirstPar(cand);
654  return Propagator ( 3,tStart,cand,origin,kFALSE,kFALSE,dj,dk );
655 }
656 
658 {
659  if ( !cand ) {
660  Error ( "GetTrack","Candidate not found: %p",cand );
661  return NULL;
662  }
663 
664  PndPidCandidate* pidCand = (PndPidCandidate*)cand->GetRecoCandidate();
665 
666  if ( !pidCand ) {
667  Error ( "GetTrack","PID Candidate not found: %p",pidCand );
668  return NULL;
669  }
670 
671  // TODO fallback should go away someday
672  int hypid=5; // default is the fallback -
673  for(int a=0; a<5; a++) {
674  if(cand->PdgCode()==fHypoPdg[a]) {
675  hypid=a;
676  break;
677  }
678  }
679 
680  PndTrack* track = ( PndTrack* ) fTracks[hypid]->At ( pidCand->GetTrackIndex() );
681 
682  if ( !track ) {
683  Warning ( "GetTrack","Could not find track object of index %d",pidCand->GetTrackIndex() );
684  return NULL;
685  }
686 
687  return track;
688 }
689 
690 FairTrackParP PndAnalysis::GetFirstPar ( RhoCandidate* cand )
691 {
692  if ( !cand ) {
693  Error ( "GetFirstPar","Candidate not found: %p",cand );
694  FairTrackParP dummy;
695  return dummy;
696  }
697  PndTrack* track = GetTrack(cand);
698 
699  if ( !track ) {
700  Warning ( "GetFirstPar","Could not find track object " );
701  FairTrackParP dummy;
702  return dummy;
703  }
704 
705  FairTrackParP tStart = track->GetParamFirst();
706 
707  return tStart;
708 }
709 
711 {
712  Bool_t success=kTRUE;
713 
714  for ( Int_t daug =0; daug<cand->NDaughters(); daug++ ) {
715  RhoCandidate* a=cand->Daughter ( daug );
716  success = success && ResetCandidate ( a );
717  }
718 
719  return success;
720 }
721 
723 {
724  FairTrackParP firstpar = GetFirstPar ( cand );
725  Double_t globalCov[6][6];
726  firstpar.GetMARSCov ( globalCov );
727  TMatrixD err ( 6,6 );
728 
729  for ( Int_t ii=0; ii<6; ii++ ) for ( Int_t jj=0; jj<6; jj++ ) {
730  err[ii][jj]=globalCov[ii][jj];
731  }
732 
733  if(fVerbose>3){ std::cout<<"MARS cov (px,py,pz,E,x,y,z): ";err.Print();}
734  TLorentzVector lv = cand->P4();
735 
737 
738  if(fVerbose>3){ std::cout<<"covPosMom (x,y,z,px,py,pz,E): ";covPosMom.Print();}
739 
740  cand->SetPosition ( firstpar.GetPosition() );
741 
742  cand->SetP3 ( firstpar.GetMomentum() ); // implicitly uses the candidates mass to set P4
743 
744  cand->SetCov7 ( covPosMom );
745 
746  return kTRUE;
747 }
748 
749 
750 Bool_t PndAnalysis::Propagator ( int mode, FairTrackParP& tStart, RhoCandidate* cand, TVector3 mypoint, Bool_t skipcov, Bool_t overwrite, TVector3 planej, TVector3 planek )
751 {
752  //Propagate from the tracks first parameter set to the POCA from mypoint
753  //The candidate is updated but the track not touched
754  //Only the uncorrelated errors are propagated,
755  //TODO: implement a real cov matrix
756 
757  Bool_t rc = kFALSE;
758  FairGeanePro* geaneProp = new FairGeanePro();
759  Int_t pdgcode = cand->PdgCode();
760 
761  if ( fVerbose>0 ) {
762  cout<<"Try mode "<<mode<<" with pdgCode "<<pdgcode<<endl;
763  }
764 
765  if ( fVerbose>2 ) {
766  std::cout<<"Start Params are:"<<std::endl;
767  tStart.Print();
768  }
769 
770  Double_t startCov[6][6];
771 
772  tStart.GetMARSCov ( startCov );
773  TMatrixD errst ( 6,6 );
774 
775  for ( Int_t ii=0; ii<6; ii++ ) for ( Int_t jj=0; jj<6; jj++ ) {
776  errst[ii][jj]=startCov[ii][jj];
777  }
778 
779  if ( fVerbose>2 ) {
780  std::cout<<"Start MARS cov: ";
781  errst.Print();
782  }
783 
784  if ( 1==mode ) { // to point
785  geaneProp->BackTrackToVertex(); //set where to propagate
786  geaneProp->SetPoint ( mypoint );
787  } else if ( 2==mode ) { // to line
788  geaneProp->PropagateToPCA ( 2, -1 );// track back to z axis
789  TVector3 ex1 ( 0.,0.,-50. ); // virtual wire of arbitrarily chosen size
790  TVector3 ex2 ( 0.,0.,100. );
791  geaneProp->SetWire ( ex1,ex2 );
792  } else if ( 3==mode ) { // to plane
793  geaneProp->PropagateToPlane(mypoint,planej,planek);
794  } else {
795  Error ( "Propagator()","Use mode 1 (to a TVector3) or mode 2 (to z axis) or mode 3 (to plane). (Mode=%i)",mode );
796  return kFALSE;
797  }
798 
799  if(skipcov) geaneProp->PropagateOnlyParameters();
800 
801  FairTrackParH* myResult=0;
802  // now we propagate
803  if(mode==3) {
804  FairTrackParP* tResult = new FairTrackParP();
805  rc = geaneProp->Propagate ( &tStart, tResult,pdgcode );
806  myResult = new FairTrackParH(*tResult);
807  } else {
808  myResult = new FairTrackParH();
809  FairTrackParH* myStart = new FairTrackParH ( tStart );
810  rc = geaneProp->Propagate ( myStart, myResult,pdgcode );
811  }
812 
813  if ( !rc ) {
814  if ( fVerbose>0 ) {
815  Warning ( "Propagator()","Geane propagation failed" );
816  }
817  return kFALSE;
818  }
819 
820  int ierr=0;
821  TVector3 di = myResult->GetMomentum();
822  di.SetMag ( 1. );
823  TVector3 dj = di.Orthogonal();
824  TVector3 dk = di.Cross ( dj );
825  FairTrackParP* myParab = new FairTrackParP ( myResult, dj, dk, ierr );
826 
827  TVector3 pos( myResult->GetX(),myResult->GetY(),myResult->GetZ() ); // I want to be sure...
828  cand->SetPosition( pos );
829  cand->SetP3( myResult->GetMomentum() ); // implicitly uses the candidates mass to set P4
830 
831  //printout for checks
832  if ( fVerbose>1 ) {
833  TVector3 vecdiff=tStart.GetPosition() - myResult->GetPosition();
834  std::cout<<"position start :";
835  tStart.GetPosition().Print();
836  std::cout<<"position ip :";
837  myResult->GetPosition().Print();
838  std::cout<<"position difference:";
839  vecdiff.Print();
840  vecdiff=tStart.GetMomentum()-myResult->GetMomentum();
841  std::cout<<"momentum start :";
842  tStart.GetMomentum().Print();
843  std::cout<<"momentum ip :";
844  myResult->GetMomentum().Print();
845  std::cout<<"momentum difference:";
846  vecdiff.Print();
847  }
848 
849  if(kFALSE==skipcov) {
850  Double_t globalCov[6][6];
851  myParab->GetMARSCov ( globalCov );
852  TMatrixD err ( 6,6 );
853 
854  for ( Int_t ii=0; ii<6; ii++ ) for ( Int_t jj=0; jj<6; jj++ ) {
855  err[ii][jj]=globalCov[ii][jj];
856  }
857 
858  if ( fVerbose>2 ) {
859  std::cout<<"MARS cov (px,py,pz,E,x,y,z): ";
860  err.Print();
861  }
862 
863  TLorentzVector lv = cand->P4();
864 
866 
867  if ( fVerbose>2 ) {
868  std::cout<<"covPosMom (x,y,z,px,py,pz,E): ";
869  covPosMom.Print();
870  }
871 
872  cand->SetCov7 ( covPosMom );
873  }
874  // rc = RhoCalculationTools::FillHelixParams(cand,skipcov);
875  // if (!rc) {Warning("Propagator()","P7toHelix failed"); return kFALSE;}
876 
877  if ( fVerbose>2 ) {
878  std::cout<<" ::::::::::: Printout in PndAnalysis::Propagator() ::::::::::: "<<std::endl;
879 
880  //std::cout<<"Start Params:"<<std::endl;
881  //myStart->Print();
882 
883  std::cout<<"SC system params:"
884  <<"\nq/p = "<<myResult->GetQp()
885  <<"\nLambda = "<<myResult->GetLambda()
886  <<"\nPhi = "<<myResult->GetPhi()
887  <<"\nX_sc = "<<myResult->GetX_sc()
888  <<"\nY_sc = "<<myResult->GetY_sc()
889  <<"\nZ_sc = "<<myResult->GetZ_sc()
890  <<std::endl;
891 
892  std::cout<<"some values:"
893  <<"\n Z0 ?= z_sc / cos(lambda) = "<< myResult->GetZ_sc() / cos ( myResult->GetLambda() )
894  <<"\n Z0 ?= sqrt(x_sc^2+z_sc^2) = "<<sqrt ( myResult->GetX_sc() *myResult->GetX_sc() +myResult->GetZ_sc() *myResult->GetZ_sc() )
895  <<std::endl;
896  }
897 
898  // COMMENT:
899  // When taking the Trackparams in the POCA to the z-axis, the SC system from GEANE matches the common helix params easier, i.e:
900  // D0 = y_sc and Z0 = sqrt(x_sc^2 + z_sc^2) = z_sc*tan(Lambda)
901 
902  if(overwrite) {
903  if ( fVerbose>1 ) {
904  Info ( "Propagator ","overwriting start parameter state with result");
905  }
906  tStart.SetTrackPar(myParab->GetV(), myParab->GetW(),
907  myParab->GetTV(), myParab->GetTW(),
908  myParab->GetQp(), myParab->GetCov(),
909  myParab->GetOrigin(),
910  myParab->GetIVer(),
911  myParab->GetJVer(),
912  myParab->GetKVer(),
913  myParab->GetSPU()
914  );
915  }
916 
917  if ( fVerbose>1 ) {
918  Info ( "Propagator ","Succsess=%i",rc );
919  }
920 
921  return kTRUE;
922 }
923 
924 
925 
927 // MC Truth matching //
929 
930 
931 
933 {
934  return MctMatch(cand,fMcCandList,level,verbose);
935 }
936 
937 Int_t PndAnalysis::McTruthMatch(RhoCandList& list, Int_t level, bool verbose)
938 {
939  Int_t ifound = 0;
940  for(int icand=0; icand<list.GetLength(); icand++) {
941  if( true == MctMatch(list[icand],fMcCandList,level,verbose) ) {
942  ifound++;
943  }
944  }
945  return ifound;
946 }
947 
949 {
950  Int_t nd = c->NDaughters();
951  Int_t pdg = c->PdgCode();
952  //Int_t nmct = mct.GetLength(); //[R.K. 01/2017] unused variable?
953 
954  if ( 0==nd ) { // final state particle
955  RhoCandidate* mccnd = c->GetMcTruth();
956  if ( !mccnd ) {
957  if(verbose) Info("PndMcTruthMatch::MctMatch","rejected final state by nonexistent mc truth pointer");
958  return false;
959  }
960  if ( mccnd->PdgCode() == pdg ) {
961  if(verbose) Info("PndMcTruthMatch::MctMatch","accepted final state by PDG code (pdg=%i)",pdg);
962  //if(verbose) std::cout<<*c<<std::endl;
963  return true;
964  } else {
965  if(verbose) Info("PndMcTruthMatch::MctMatch","rejected final state by PDG Code (pdg=%i|mcpdg=%i)",pdg, mccnd->PdgCode());
966  return false;
967  }
968  }
969 
970  // check recursively whether all daughter trees match
971  for ( Int_t i=0; i<nd; i++ ) {
972  if ( !MctMatch ( c->Daughter ( i ) , mct, level, verbose ) ) {
973  if(verbose) Info("PndMcTruthMatch::MctMatch","rejected composite (pdg=%i) by non-matching daughter: idau=%i",pdg,i);
974  return false;
975  }
976  }
977 
978  // ***
979  // *** MATCH LEVEL 0 reached: only PID of final state particles are matched
980  // ***
981  if ( 0==level ) {
982  return true;
983  }
984  //if(verbose)std::cout<<"going Level 1"<<std::endl;
985  // reset mc truth pointer
986  RhoCandidate* mccnd = c->GetMcTruth();
987  if(mccnd) {
988  if(verbose) Warning("PndMcTruthMatch::MctMatch","Existing MC truth found. Will reset it now.");
989  c->SetMcTruth(0);
990  //return false;
991  }
992 
993  // find this particle's truth in the mc decay tree
994  RhoCandidate* dauzero = c->Daughter(0);
995  if (!dauzero) {
996  if(verbose) Info("PndMcTruthMatch::MctMatch","rejected by not existing daughter zero");
997  return false;
998  }
999  RhoCandidate* mcdauzero = dauzero->GetMcTruth();
1000  if (!mcdauzero) {
1001  if(verbose) Info("PndMcTruthMatch::MctMatch","rejected by not existing MC truth of daughter zero");
1002  return false;
1003  }
1004  RhoCandidate* mcdauzeromother=mcdauzero->TheMother();
1005  if (!mcdauzeromother) {
1006  if(verbose) {
1007  Info("PndMcTruthMatch::MctMatch","rejected by not existing mother of MC truth of daughter zero");
1008  cout <<*mcdauzero<<endl;
1009  }
1010 
1011  return false;
1012  }
1013 
1014  //now check the tree structure:
1015 
1016  int ndaudiff = mcdauzeromother->NDaughters() - nd;
1017 
1018  // we still might accept if only photos photons are missing in the reco tree
1019  // if overall difference is small enough, we check further below what particles are missing
1020  if( ndaudiff<0 || ndaudiff>fPhotosMax )
1021  {
1022  if(verbose) Info("PndMcTruthMatch::MctMatch","rejected by differing daughter count: cand:%i mc:%i",c->NDaughters(),mcdauzeromother->NDaughters());
1023  return false;
1024  }
1025  // count daughter photons (pdg==22) from MC mother with E < photos_thresh
1026  int nphall = 0;
1027  if (ndaudiff>0)
1028  for (int idau=0; idau<mcdauzeromother->NDaughters(); ++idau)
1029  if (mcdauzeromother->Daughter(idau)->PdgCode()==22 && mcdauzeromother->Daughter(idau)->E()<fPhotosThresh) nphall++;
1030 
1031  // reco'd photons with E<photos_thresh
1032  int nphreco = 0;
1033  // now if all daughters MC-Mother is the same
1034  for(int idau=1; idau<nd; idau++) {
1035  // look if all daughters mc mothers are the same
1036  RhoCandidate* dau = c->Daughter(idau);
1037  if (!dau) {
1038  if(verbose) Info("PndMcTruthMatch::MctMatch","rejected by not existing daughter %i",idau);
1039  return false;
1040  }
1041  RhoCandidate* mcdau = dau->GetMcTruth();
1042  if (!mcdau) {
1043  if(verbose) Info("PndMcTruthMatch::MctMatch","rejected by not existing MC truth of daughter %i",idau);
1044  //if(verbose) std::cout<<*dau<<std::endl;
1045  return false;
1046  }
1047  RhoCandidate* mcdaumother=mcdau->TheMother();
1048  if (!mcdaumother) {
1049  if(verbose) Info("PndMcTruthMatch::MctMatch","rejected by not existing mother of MC truth of daughter %i",idau);
1050  return false;
1051  }
1052  if(mcdaumother!=mcdauzeromother) {
1053  if(verbose) Info("PndMcTruthMatch::MctMatch","rejected by mc mother of daughter %i(%p) is different to mc mother of daughter zero(%p) -> Tree does not match"
1054  ,idau,mcdaumother,mcdauzeromother);
1055  return false;
1056  }
1057 
1058  // daughter was correctly matched; now check for low energetic photon for photos accept
1059  if (ndaudiff>0 && mcdau->PdgCode()==22 && mcdau->E()<fPhotosThresh) nphreco++;
1060  }
1061  // difference in #phot<max allowed and has to be exactly the total number of particle difference
1062  if ( (nphall-nphreco)>fPhotosMax || (nphall-nphreco)!=ndaudiff )
1063  {
1064  if(verbose) Info("PndMcTruthMatch::MctMatch","rejected by differing daughter count not being photos photons: cand:%i mc:%i",c->NDaughters(),mcdauzeromother->NDaughters());
1065  return false;
1066  }
1067 
1068  // ***
1069  // *** MATCH LEVEL 1: PID of the leaves and tree topology are matched
1070  // ***
1071  if ( 1==level ) {
1072  if (verbose) Info("PndMcTruthMatch::MctMatch","accepted composite(pdg=%i) on match-level 1",pdg);
1073  c->SetMcTruth(mcdauzeromother);
1074  if (verbose) cout <<*c->GetMcTruth()<<endl;
1075  return true;
1076  }
1077  //if(verbose)std::cout<<"going Level 2"<<std::endl;
1078  // check whether all daughter's mother has correct PDG code
1079  if ( pdg != mcdauzeromother->PdgCode() ) {
1080  if(verbose) Info("PndMcTruthMatch::MctMatch","rejected by nonmatching pdg code in tree (pdgcode|mcpdgcode) (%i|%i)",pdg,mcdauzeromother->PdgCode());
1081  return false;
1082  }
1083  // ***
1084  // *** MATCH LEVEL 2: PID of leaves, tree topology and intermediate particle types are matched
1085  // ***
1086  if (verbose) Info("PndMcTruthMatch::MctMatch","accepted composite(pdg=%i) on match-level 2", pdg);
1087  c->SetMcTruth(mcdauzeromother);
1088  if (verbose) cout <<*c->GetMcTruth()<<endl;
1089  return true; // c's tree matches!
1090 }
1091 
1092 
1093 
1094 
1095 
1096 
1097 
1098 
1099 
Int_t GetEntries()
std::array< TClonesArray *, 6 > fChargedProbability
Definition: PndAnalysis.h:103
TVector3 pos
Int_t GetTrackIndex() const
Int_t fHypoPdg[6]
Definition: PndAnalysis.h:120
void Add(const RhoCandidate *c)
Definition: RhoCandList.h:49
int fVerbose
Definition: poormantracks.C:24
Bool_t ResetCandidate(RhoCandidate *cand)
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
TClonesArray * ReadTCA(TString tcaname)
Definition: PndAnalysis.cxx:78
Bool_t PropagateToPoint(RhoCandidate *cand, TVector3 mypoint)
PndTrack * GetTrack(RhoCandidate *cand)
ClassImp(PndAnalysis)
void SetTcaNames(TString &names, TString postfix="")
TClonesArray * fMcCands
Definition: PndAnalysis.h:107
void Cleanup()
Definition: RhoCandList.cxx:62
Bool_t fBuildMcCands
Definition: PndAnalysis.h:93
FairTrackParP GetFirstPar(RhoCandidate *cand)
virtual ~PndAnalysis()
Definition: PndAnalysis.cxx:71
std::array< RhoCandList, 6 > fChargedCandList
Definition: PndAnalysis.h:110
void SetPos(const TVector3 &pos)
Definition: RhoCandidate.h:235
Int_t i
Definition: run_full.C:25
Int_t fVerbose
Definition: PndAnalysis.h:94
Bool_t Apply(RhoCandidate *tc)
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
FairMCEventHeader * GetEventHeader()
PndRiemannTrack track
Definition: RiemannTest.C:33
Int_t GetPdgCode() const
Definition: PndMCTrack.h:73
#define verbose
Bool_t PropagateToZAxis(RhoCandidate *cand)
Double_t fPhotosThresh
Definition: PndAnalysis.h:96
Int_t GetLength() const
Definition: RhoCandList.h:46
static void Reset()
Definition: RhoFactory.cxx:28
RhoCandList fMcCandList
Definition: PndAnalysis.h:112
int n
PndAnaPidSelector * fPidSelector
Definition: PndAnalysis.h:88
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
PndPidCandidate * GetRecoCandidate() const
Definition: RhoCandidate.h:376
Bool_t MctMatch(RhoCandidate &c, RhoCandList &mct, Int_t level=2, bool verbose=false)
Definition: PndAnalysis.h:83
RhoCandidate * Daughter(Int_t n)
Int_t fEvtCount
Definition: PndAnalysis.h:90
Bool_t GetMcCandList(RhoCandList &l)
Int_t Uid() const
Definition: RhoCandidate.h:419
void SetPosition(const TVector3 &pos)
Bool_t PropagateToPlane(RhoCandidate *cand, TVector3 origin, TVector3 dj, TVector3 dk)
Bool_t SetCriterion(TString &crit)
TLorentzVector Get4Momentum() const
Definition: PndMCTrack.cxx:102
Int_t GetMcIndex() const
Int_t fDefaultHypo
Flag to check which hypo lists exists //0-4 for trk hypothesis, 5 for fallback.
Definition: PndAnalysis.h:122
cout<< "blue = Monte Carlo "<< endl;cout<< "red = Helix Hit "<< endl;cout<< "green = Center Of Tubes "<< endl;for(Int_t k=0;k< track->GetEntriesFast();k++){PndSttTrack *stttrack=(PndSttTrack *) track-> At(k)
Definition: checkhelixhit.C:56
void SetType(const TParticlePDG *pdt)
void SetP4(Double_t mass, const TVector3 &p3)
Int_t mode
Definition: autocutx.C:47
PndAnaPidCombiner * fPidCombiner
Definition: PndAnalysis.h:89
std::array< TClonesArray *, 6 > fBremCorr
Definition: PndAnalysis.h:101
Int_t a
Definition: anaLmdDigi.C:126
void GetEventInTask()
void BuildMcCands()
void SetP3(const TVector3 &p3)
Double_t
TClonesArray * fMcTracks
Definition: PndAnalysis.h:108
PndAnalysis(TString tname1="", TString tname2="", TString algnamec="PidAlgoIdealCharged", TString algnamen="PidAlgoIdealNeutral")
Definition: PndAnalysis.cxx:48
void ReadRecoCandidates()
TString fChargedPidName
Definition: PndAnalysis.h:114
void Select(RhoParticleSelectorBase *pidmgr)
TLorentzVector P4() const
Definition: RhoCandidate.h:195
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
void Reset()
Definition: PndAnalysis.h:37
static RhoFactory * Instance()
Definition: RhoFactory.cxx:34
void Cleanup()
Bool_t Propagator(int mode, FairTrackParP &tStart, RhoCandidate *cand, TVector3 point=TVector3(0, 0, 0), Bool_t skipcov=kFALSE, Bool_t overwrite=kFALSE, TVector3 planej=TVector3(1, 0, 0), TVector3 planek=TVector3(0, 1, 0))
static TMatrixD GetConverted7(TMatrixD)
RhoCandidate * GetMcTruth() const
Definition: RhoCandidate.h:437
Double_t E() const
Definition: RhoCandidate.h:202
TString fPidHypoStr[6]
Definition: PndAnalysis.h:119
TString fTracksName2
Definition: PndAnalysis.h:117
std::array< TClonesArray *, 6 > fTracks
Definition: PndAnalysis.h:105
FairRootManager * fRootManager
Definition: PndAnalysis.h:87
void SetMcTruth(RhoCandidate *mct)
Definition: RhoCandidate.h:436
int reco()
void SetTrackNumber(Int_t trnum=-1)
Definition: RhoCandidate.h:418
TString fTracksName
Definition: PndAnalysis.h:116
Int_t GetSecondMotherID() const
Definition: PndMCTrack.h:75
Int_t NDaughters() const
Bool_t PropagateToIp(RhoCandidate *cand)
static TMatrixDSym GetFitError(TMatrixDSym)
Double_t Charge() const
Definition: RhoCandidate.h:184
RhoCandList fNeutralCandList
Definition: PndAnalysis.h:111
void Put(const RhoCandidate *, Int_t i=-1)
Definition: RhoCandList.cxx:77
Int_t fChainEntries
Definition: PndAnalysis.h:91
Bool_t McTruthMatch(RhoCandidate *cand, Int_t level=2, bool verbose=false)
Int_t fPhotosMax
Definition: PndAnalysis.h:95
Bool_t fHypoFlagCharged[6]
Definition: PndAnalysis.h:121
Int_t GetEvent(Int_t n=-1)
TVector3 GetStartVertex() const
Definition: PndMCTrack.h:76
Int_t GetMotherID() const
Definition: PndMCTrack.h:74
TVector3 vecdiff
Definition: anaLmdReco.C:77
std::array< TClonesArray *, 6 > fTracks2
Definition: PndAnalysis.h:106
Bool_t fEventRead
Definition: PndAnalysis.h:92
void SetCov7(const TMatrixD &cov7)
TClonesArray * fNeutralCands
Definition: PndAnalysis.h:102
const RhoCandidate * TheMother() const
Definition: RhoCandidate.h:272
std::array< TClonesArray *, 6 > fChargedCands
Definition: PndAnalysis.h:100
Bool_t ResetDaughters(RhoCandidate *cand)
FairTrackParP GetParamFirst()
Definition: PndTrack.h:49
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
RhoCandidate * Get(Int_t)
Definition: RhoCandList.cxx:94