1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 // MC reader for jet analysis
18 // Author: Mercedes Lopez Noriega (mercedes.lopez.noriega@cern.ch)
21 #include <TClonesArray.h>
23 #include <TParticle.h>
24 #include <TParticlePDG.h>
26 #include <TLorentzVector.h>
29 #include "AliJetMCReader.h"
30 #include "AliJetMCReaderHeader.h"
32 #include "AliESDtrack.h"
34 ClassImp(AliJetMCReader)
36 AliJetMCReader::AliJetMCReader()
44 //____________________________________________________________________________
46 AliJetMCReader::~AliJetMCReader()
52 //____________________________________________________________________________
55 void AliJetMCReader::FillMomentumArray(Int_t event)
57 // Fill momentum array
58 TClonesArray &arrayMC = *fArrayMC;
66 // get event from chains
67 fChain->GetEntry(event);
68 fChainMC->GetEntry(event);
69 // get number of tracks in event (for the loop)
70 nt = fESD->GetNumberOfTracks();
72 // get cuts set by user
73 Double_t ptMin = ((AliJetMCReaderHeader*) fReaderHeader)->GetPtCut();
76 for (Int_t it = 0; it < nt; it++) {
77 AliESDtrack *track = fESD->GetTrack(it); //track
78 UInt_t status = track->GetStatus();
79 if ((status & AliESDtrack::kITSrefit) == 0) continue; // quality check
80 // track->GetImpactParameters(dca,z);
81 // if (dca > dcaMax) continue; // check track is reasonable
82 Int_t label = TMath::Abs(track->GetLabel());
83 TParticle *part = (TParticle*)arrayMC[label]; //particle
84 pt = part->Pt(); // pt of the particle
85 if (pt < ptMin) continue; //check cuts
88 fMass = part->GetCalcMass();
89 fPdgC = part->GetPdgCode();
90 // fill momentum array
91 new ((*fMomentumArray)[goodTrack]) TLorentzVector(p.X(), p.Y(), p.Z(), e);
94 printf("\nNumber of good tracks %d \n", goodTrack);