Updated version of tag classes (P.Christakoglou)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Aug 2005 13:31:26 +0000 (13:31 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Aug 2005 13:31:26 +0000 (13:31 +0000)
STEER/AliEventTag.cxx
STEER/AliEventTag.h
STEER/AliReconstruction.cxx
STEER/AliRunTag.h

index 8f845db02ac9fe4f47ded469cf587b0d8dfc6853..e690f8c854963a9901f3d3bd3f56c504553c19df 100644 (file)
@@ -68,9 +68,17 @@ AliEventTag::AliEventTag()
 
   fMaxJetEnergy = -100.0;
   fMaxNeutralEnergy = -100.0; 
-  fNumberOfChargedAbovePtRange = -10;
-  fNumberOfMuonsAbovePtRange = -10;
-  fNumberOfElectronsAbovePtRange = -10;
+  
+  fNumberOfChargedAbove1GeV = -10;
+  fNumberOfChargedAbove3GeV = -10;
+  fNumberOfChargedAbove10GeV = -10;
+  fNumberOfMuonsAbove1GeV = -10;
+  fNumberOfMuonsAbove3GeV = -10;
+  fNumberOfMuonsAbove10GeV = -10;
+  fNumberOfElectronsAbove1GeV = -10;
+  fNumberOfElectronsAbove3GeV = -10;
+  fNumberOfElectronsAbove10GeV = -10;
+
 
   fNumberOfElectrons = -10;
   fNumberOfMuons = -10;
@@ -84,14 +92,7 @@ AliEventTag::AliEventTag()
   fNumberOfNeutrons = -10;
   fNumberOfKaon0s = -10;
 
-  fNumberOfJPsiCandidates = -10;
-  fNumberOfPsiPrimeCandidates = -10;
-  fNumberOfUpsilonCandidates = -10;
-  fNumberOfUpsilonPrimeCandidates = -10;
-  fNumberOfUpsilonDoublePrimeCandidates = -10;
-  fNumberOfCharmParticleCandidates = -10;
-  fNumberOfBeautyParticleCandidates = -10;
-  
+   
   fTotalP = -10.0;
   fMeanPt = -10.0;
   fMaxPt = -10.0;
@@ -150,20 +151,17 @@ AliEventTag::AliEventTag(AliEventTag *EvTag)
 
   SetMaxJetEnergy(EvTag->GetMaxJetEnergy());
   SetMaxNeutralEnergy(EvTag->GetMaxNeutralEnergy());
-  SetNumOfChargedAbovePtRange(EvTag->GetNumOfChargedAbovePtRange());
-  SetNumOfMuonsAbovePtRange(EvTag->GetNumOfMuonsAbovePtRange());
-  SetNumOfElectronsAbovePtRange(EvTag->GetNumOfElectronsAbovePtRange());
-
-
-
-  SetNumOfJPsiCandidates(EvTag->GetNumOfJPsiCandidates());
-  SetNumOfPsiPrimeCandidates(EvTag->GetNumOfPsiPrimeCandidates());
-  SetNumOfUpsilonCandidates(EvTag->GetNumOfUpsilonCandidates());
-  SetNumOfUpsilonPrimeCandidates(EvTag->GetNumOfUpsilonPrimeCandidates());
-  SetNumOfUpsilonDoublePrimeCandidates(EvTag->GetNumOfUpsilonDoublePrimeCandidates());
-  SetNumOfCharmCandidates(EvTag->GetNumOfCharmCandidates());
-  SetNumOfBeautyCandidates(EvTag->GetNumOfBeautyCandidates());
   
+  SetNumOfChargedAbove1GeV(EvTag->GetNumOfChargedAbove1GeV());
+  SetNumOfChargedAbove3GeV(EvTag->GetNumOfChargedAbove3GeV());
+  SetNumOfChargedAbove10GeV(EvTag->GetNumOfChargedAbove10GeV());
+  SetNumOfMuonsAbove1GeV(EvTag->GetNumOfMuonsAbove1GeV());
+  SetNumOfMuonsAbove3GeV(EvTag->GetNumOfMuonsAbove3GeV());
+  SetNumOfMuonsAbove10GeV(EvTag->GetNumOfMuonsAbove10GeV());
+  SetNumOfElectronsAbove1GeV(EvTag->GetNumOfElectronsAbove1GeV());
+  SetNumOfElectronsAbove3GeV(EvTag->GetNumOfElectronsAbove3GeV());
+  SetNumOfElectronsAbove10GeV(EvTag->GetNumOfElectronsAbove10GeV());
+
   SetNumOfElectrons(EvTag->GetNumOfElectrons());
   SetNumOfMuons(EvTag->GetNumOfMuons());
   SetNumOfPions(EvTag->GetNumOfPions());
index 0015a5d8c0b71c06cc73996c4cb864bb5fc5a206..a903f8de415fb7342213ffe6a919e9aa22de0262 100644 (file)
@@ -56,9 +56,17 @@ class AliEventTag : public TObject
   Int_t    fNumberOfHardPhotonsCandidates;     //Hard photons candidates
 
   Float_t  fMaxNeutralEnergy;                   //neutral energy info
-  Int_t    fNumberOfChargedAbovePtRange;
-  Int_t    fNumberOfMuonsAbovePtRange;
-  Int_t    fNumberOfElectronsAbovePtRange;
+  
+
+  Int_t    fNumberOfChargedAbove1GeV;
+  Int_t    fNumberOfChargedAbove3GeV;
+  Int_t    fNumberOfChargedAbove10GeV;
+  Int_t    fNumberOfMuonsAbove1GeV;
+  Int_t    fNumberOfMuonsAbove3GeV;
+  Int_t    fNumberOfMuonsAbove10GeV; 
+  Int_t    fNumberOfElectronsAbove1GeV;
+  Int_t    fNumberOfElectronsAbove3GeV;
+  Int_t    fNumberOfElectronsAbove10GeV;
 
 
 
@@ -75,13 +83,6 @@ class AliEventTag : public TObject
   Int_t    fNumberOfKaon0s;
 
 
-  Int_t    fNumberOfJPsiCandidates;           //JPsi candidates
-  Int_t    fNumberOfPsiPrimeCandidates;               //Psi prime candidates
-  Int_t    fNumberOfUpsilonCandidates;        //Upsilon candidates
-  Int_t    fNumberOfUpsilonPrimeCandidates;    //Upsilon prime candidates
-  Int_t    fNumberOfUpsilonDoublePrimeCandidates;
-  Int_t    fNumberOfCharmParticleCandidates;
-  Int_t    fNumberOfBeautyParticleCandidates;
  
   Float_t  fTotalP;                           //Sum of the momentum per event
   Float_t  fMeanPt;                           //Mean Pt per event
@@ -140,17 +141,16 @@ class AliEventTag : public TObject
 
   void   SetMaxJetEnergy(Float_t f) {fMaxJetEnergy = f;}
   void   SetMaxNeutralEnergy(Float_t f) {fMaxNeutralEnergy = f;}
-  void   SetNumOfChargedAbovePtRange(Int_t i) {fNumberOfChargedAbovePtRange = i;}
-  void   SetNumOfMuonsAbovePtRange(Int_t i) {fNumberOfMuonsAbovePtRange = i;}
-  void   SetNumOfElectronsAbovePtRange(Int_t i) {fNumberOfElectronsAbovePtRange = i;}
-
-  void   SetNumOfJPsiCandidates(Int_t Ptr) {fNumberOfJPsiCandidates = Ptr;}
-  void   SetNumOfPsiPrimeCandidates(Int_t Ptr) {fNumberOfPsiPrimeCandidates = Ptr;}
-  void   SetNumOfUpsilonCandidates(Int_t Ptr) {fNumberOfUpsilonCandidates = Ptr;}
-  void   SetNumOfUpsilonPrimeCandidates(Int_t Ptr) {fNumberOfUpsilonPrimeCandidates = Ptr;}
-  void   SetNumOfUpsilonDoublePrimeCandidates(Int_t Ptr) {fNumberOfUpsilonDoublePrimeCandidates = Ptr;}
-  void   SetNumOfCharmCandidates(Int_t Ptr) {fNumberOfCharmParticleCandidates = Ptr;}
-  void   SetNumOfBeautyCandidates(Int_t Ptr) {fNumberOfBeautyParticleCandidates = Ptr;}
+  
+  void   SetNumOfChargedAbove1GeV(Int_t i) {fNumberOfChargedAbove1GeV = i;}
+  void   SetNumOfChargedAbove3GeV(Int_t i) {fNumberOfChargedAbove3GeV = i;}
+  void   SetNumOfChargedAbove10GeV(Int_t i) {fNumberOfChargedAbove10GeV = i;}
+  void   SetNumOfMuonsAbove1GeV(Int_t i) {fNumberOfMuonsAbove1GeV = i;}
+  void   SetNumOfMuonsAbove3GeV(Int_t i) {fNumberOfMuonsAbove3GeV = i;}
+  void   SetNumOfMuonsAbove10GeV(Int_t i) {fNumberOfMuonsAbove10GeV = i;}
+  void   SetNumOfElectronsAbove1GeV(Int_t i) {fNumberOfElectronsAbove1GeV = i;}
+  void   SetNumOfElectronsAbove3GeV(Int_t i) {fNumberOfElectronsAbove3GeV = i;}
+  void   SetNumOfElectronsAbove10GeV(Int_t i) {fNumberOfElectronsAbove10GeV = i;}
 
   void   SetNumOfElectrons(Int_t Ptr) {fNumberOfElectrons = Ptr;}
   void   SetNumOfMuons(Int_t Ptr) {fNumberOfMuons = Ptr;}
@@ -220,19 +220,17 @@ class AliEventTag : public TObject
 
   Float_t GetMaxJetEnergy() {return fMaxJetEnergy;}
   Float_t GetMaxNeutralEnergy() {return fMaxNeutralEnergy;}
-  Int_t   GetNumOfChargedAbovePtRange() {return fNumberOfChargedAbovePtRange;}
-  Int_t   GetNumOfMuonsAbovePtRange() {return fNumberOfMuonsAbovePtRange;}
-  Int_t   GetNumOfElectronsAbovePtRange() {return fNumberOfElectronsAbovePtRange;}
-
-
-  Int_t   GetNumOfJPsiCandidates() {return fNumberOfJPsiCandidates;}
-  Int_t   GetNumOfPsiPrimeCandidates() {return fNumberOfPsiPrimeCandidates;}
-  Int_t   GetNumOfUpsilonCandidates() {return fNumberOfUpsilonCandidates;}
-  Int_t   GetNumOfUpsilonPrimeCandidates() {return fNumberOfUpsilonPrimeCandidates;}
-  Int_t   GetNumOfUpsilonDoublePrimeCandidates() {return fNumberOfUpsilonDoublePrimeCandidates;}
-  Int_t   GetNumOfCharmCandidates() {return fNumberOfCharmParticleCandidates;}
-  Int_t   GetNumOfBeautyCandidates() {return fNumberOfBeautyParticleCandidates;}
-
+  
+  Int_t   GetNumOfChargedAbove1GeV() {return fNumberOfChargedAbove1GeV;}
+  Int_t   GetNumOfChargedAbove3GeV() {return fNumberOfChargedAbove3GeV;}
+  Int_t   GetNumOfChargedAbove10GeV() {return fNumberOfChargedAbove10GeV;}
+  Int_t   GetNumOfMuonsAbove1GeV() {return fNumberOfMuonsAbove1GeV;}
+  Int_t   GetNumOfMuonsAbove3GeV() {return fNumberOfMuonsAbove3GeV;}
+  Int_t   GetNumOfMuonsAbove10GeV() {return fNumberOfMuonsAbove10GeV;}
+  Int_t   GetNumOfElectronsAbove1GeV() {return fNumberOfElectronsAbove1GeV;}
+  Int_t   GetNumOfElectronsAbove3GeV() {return fNumberOfElectronsAbove3GeV;}
+  Int_t   GetNumOfElectronsAbove10GeV() {return fNumberOfElectronsAbove10GeV;}
   Int_t   GetNumOfElectrons() {return fNumberOfElectrons;}
   Int_t   GetNumOfMuons() {return fNumberOfMuons;}
   Int_t   GetNumOfPions() {return fNumberOfPions;}
@@ -258,7 +256,7 @@ class AliEventTag : public TObject
   Float_t GetEventPlaneAngle() {return fEventPlaneAngle;}
   Float_t GetHBTRadii() {return fHBTRadii;}
 
-  ClassDef(AliEventTag,1)  //(ClassName, ClassVersion)
+  ClassDef(AliEventTag,2)  //(ClassName, ClassVersion)
     };
 //______________________________________________________________________________
 
index ee0a83670c46057f2e959d66fe323bc26e9c3adf..09e76a7525362397ace152ef66171556df522333 100644 (file)
@@ -1175,6 +1175,15 @@ void AliReconstruction::WriteESD(AliESD* esd, const char* recStep) const
 //_____________________________________________________________________________
 void AliReconstruction::CreateTag(TFile* file)
 {
+  Int_t ntrack;
+  Int_t NProtons, NKaons, NPions, NMuons, NElectrons;
+  Int_t Npos, Nneg, Nneutr;
+  Int_t NK0s, Nneutrons, Npi0s, Ngamas;
+  Int_t Nch1GeV, Nch3GeV, Nch10GeV;
+  Int_t Nmu1GeV, Nmu3GeV, Nmu10GeV;
+  Int_t Nel1GeV, Nel3GeV, Nel10GeV;
+  Float_t MaxPt = .0, MeanPt = .0, TotalP = .0;
+
   AliRunTag *tag = new AliRunTag();
   AliDetectorTag *detTag = new AliDetectorTag();
   AliEventTag *evTag = new AliEventTag();
@@ -1201,24 +1210,187 @@ void AliReconstruction::CreateTag(TFile* file)
   Int_t i_NumberOfEvents = b->GetEntries();
   for (Int_t i_EventNumber = 0; i_EventNumber < i_NumberOfEvents; i_EventNumber++)
     {
+      ntrack = 0;
+      Npos = 0;
+      Nneg = 0;
+      Nneutr =0;
+      NK0s = 0;
+      Nneutrons = 0;
+      Npi0s = 0;
+      Ngamas = 0;
+      NProtons = 0;
+      NKaons = 0;
+      NPions = 0;
+      NMuons = 0;
+      NElectrons = 0;    
+      Nch1GeV = 0;
+      Nch3GeV = 0;
+      Nch10GeV = 0;
+      Nmu1GeV = 0;
+      Nmu3GeV = 0;
+      Nmu10GeV = 0;
+      Nel1GeV = 0;
+      Nel3GeV = 0;
+      Nel10GeV = 0;
+      MaxPt = .0;
+      MeanPt = .0;
+      TotalP = .0;
+
       b->GetEntry(i_EventNumber);
-      //      Int_t i_NumberOfTracks = esd->GetNumberOfTracks();
       const AliESDVertex * VertexIn = esd->GetVertex();
+
+      for (Int_t i_TrackNumber = 0; i_TrackNumber < esd->GetNumberOfTracks(); i_TrackNumber++)
+       {
+         AliESDtrack * ESDTrack = esd->GetTrack(i_TrackNumber);
+         UInt_t status = ESDTrack->GetStatus();
+         
+         //select only tracks with ITS refit
+         if ((status&AliESDtrack::kITSrefit)==0) continue;
+         
+         //select only tracks with TPC refit-->remove extremely high Pt tracks
+         if ((status&AliESDtrack::kTPCrefit)==0) continue;
+         
+         //select only tracks with the "combined PID"
+         if ((status&AliESDtrack::kESDpid)==0) continue;
+                 Double_t p[3];
+         ESDTrack->GetPxPyPz(p);
+         Double_t P = sqrt(pow(p[0],2) + pow(p[1],2) + pow(p[2],2));
+         Double_t fPt = sqrt(pow(p[0],2) + pow(p[1],2));
+         TotalP += P;
+         MeanPt += fPt;
+         if(fPt > MaxPt)
+           MaxPt = fPt;
+         
+         if(ESDTrack->GetSign() > 0)
+           {
+             Npos++;
+             if(fPt > 1.0)
+               Nch1GeV++;
+             if(fPt > 3.0)
+               Nch3GeV++;
+             if(fPt > 10.0)
+               Nch10GeV++;
+           }
+         if(ESDTrack->GetSign() < 0)
+           {
+             Nneg++;
+             if(fPt > 1.0)
+               Nch1GeV++;
+             if(fPt > 3.0)
+               Nch3GeV++;
+             if(fPt > 10.0)
+               Nch10GeV++;
+           }
+         if(ESDTrack->GetSign() == 0)
+           Nneutr++;
+         
+         //PID
+         Double_t prob[10];
+         ESDTrack->GetESDpid(prob);
+                   
+         //K0s
+         if ((prob[8]>prob[7])&&(prob[8]>prob[6])&&(prob[8]>prob[5])&&(prob[8]>prob[4])&&(prob[8]>prob[3])&&(prob[8]>prob[2])&&(prob[8]>prob[1])&&(prob[8]>prob[0]))
+           NK0s++;
+         //neutrons
+         if ((prob[7]>prob[8])&&(prob[7]>prob[6])&&(prob[7]>prob[5])&&(prob[7]>prob[4])&&(prob[7]>prob[3])&&(prob[7]>prob[2])&&(prob[7]>prob[1])&&(prob[7]>prob[0]))
+           Nneutrons++; 
+         //pi0s
+         if ((prob[6]>prob[8])&&(prob[6]>prob[7])&&(prob[6]>prob[5])&&(prob[6]>prob[4])&&(prob[6]>prob[3])&&(prob[6]>prob[2])&&(prob[6]>prob[1])&&(prob[6]>prob[0]))
+           Npi0s++;
+         //gamas
+         if ((prob[5]>prob[8])&&(prob[5]>prob[7])&&(prob[5]>prob[6])&&(prob[5]>prob[4])&&(prob[5]>prob[3])&&(prob[5]>prob[2])&&(prob[5]>prob[1])&&(prob[5]>prob[0]))
+           Ngamas++;
+         //protons
+         if ((prob[4]>prob[8])&&(prob[4]>prob[7])&&(prob[4]>prob[6])&&(prob[4]>prob[5])&&(prob[4]>prob[3])&&(prob[4]>prob[2])&&(prob[4]>prob[1])&&(prob[4]>prob[0]))
+           NProtons++;
+         //kaons
+         if ((prob[3]>prob[8])&&(prob[3]>prob[7])&&(prob[3]>prob[6])&&(prob[3]>prob[5])&&(prob[3]>prob[4])&&(prob[3]>prob[2])&&(prob[3]>prob[1])&&(prob[3]>prob[0]))
+           NKaons++;
+         //kaons
+         if ((prob[2]>prob[8])&&(prob[2]>prob[7])&&(prob[2]>prob[6])&&(prob[2]>prob[5])&&(prob[2]>prob[4])&&(prob[2]>prob[3])&&(prob[2]>prob[1])&&(prob[2]>prob[0]))
+           NPions++; 
+         //muons
+         if ((prob[1]>prob[8])&&(prob[1]>prob[7])&&(prob[1]>prob[6])&&(prob[1]>prob[5])&&(prob[1]>prob[4])&&(prob[1]>prob[3])&&(prob[1]>prob[2])&&(prob[1]>prob[0]))
+           {
+             NMuons++;
+             if(fPt > 1.0)
+               Nmu1GeV++;
+             if(fPt > 3.0)
+               Nmu3GeV++;
+             if(fPt > 10.0)
+               Nmu10GeV++;
+           }
+         //electrons
+         if ((prob[0]>prob[8])&&(prob[0]>prob[7])&&(prob[0]>prob[6])&&(prob[0]>prob[5])&&(prob[0]>prob[4])&&(prob[0]>prob[3])&&(prob[0]>prob[2])&&(prob[0]>prob[1]))
+           {
+             NElectrons++;
+             if(fPt > 1.0)
+               Nel1GeV++;
+             if(fPt > 3.0)
+               Nel3GeV++;
+             if(fPt > 10.0)
+               Nel10GeV++;
+           }
+         
+         
+         
+         ntrack++;
+       }//track loop
+      // Fill the event tags 
+      MeanPt = MeanPt/ntrack;
       
       evTag->SetEventId(i_EventNumber+1);
-
       evTag->SetVertexX(VertexIn->GetXv());
       evTag->SetVertexY(VertexIn->GetYv());
       evTag->SetVertexZ(VertexIn->GetZv());
-
+      
+      evTag->SetT0VertexZ(esd->GetT0zVertex());
+      
+      evTag->SetTrigger(esd->GetTrigger());
+      
+      evTag->SetZDCNeutronEnergy(esd->GetZDCNEnergy());
+      evTag->SetZDCProtonEnergy(esd->GetZDCPEnergy());
+      evTag->SetZDCEMEnergy(esd->GetZDCEMEnergy());
+      evTag->SetNumOfParticipants(esd->GetZDCParticipants());
+      
+      
       evTag->SetNumOfTracks(esd->GetNumberOfTracks());
+      evTag->SetNumOfPosTracks(Npos);
+      evTag->SetNumOfNegTracks(Nneg);
+      evTag->SetNumOfNeutrTracks(Nneutr);
+      
       evTag->SetNumOfV0s(esd->GetNumberOfV0s());
       evTag->SetNumOfCascades(esd->GetNumberOfCascades());
+      evTag->SetNumOfKinks(esd->GetNumberOfKinks());
+      evTag->SetNumOfPMDTracks(esd->GetNumberOfPmdTracks());
+      
+      evTag->SetNumOfProtons(NProtons);
+      evTag->SetNumOfKaons(NKaons);
+      evTag->SetNumOfPions(NPions);
+      evTag->SetNumOfMuons(NMuons);
+      evTag->SetNumOfElectrons(NElectrons);
+      evTag->SetNumOfPhotons(Ngamas);
+      evTag->SetNumOfPi0s(Npi0s);
+      evTag->SetNumOfNeutrons(Nneutrons);
+      evTag->SetNumOfKaon0s(NK0s);
+      
+      evTag->SetNumOfChargedAbove1GeV(Nch1GeV);
+      evTag->SetNumOfChargedAbove3GeV(Nch3GeV);
+      evTag->SetNumOfChargedAbove10GeV(Nch10GeV);
+      evTag->SetNumOfMuonsAbove1GeV(Nmu1GeV);
+      evTag->SetNumOfMuonsAbove3GeV(Nmu3GeV);
+      evTag->SetNumOfMuonsAbove10GeV(Nmu10GeV);
+      evTag->SetNumOfElectronsAbove1GeV(Nel1GeV);
+      evTag->SetNumOfElectronsAbove3GeV(Nel3GeV);
+      evTag->SetNumOfElectronsAbove10GeV(Nel10GeV);
       
       evTag->SetNumOfPHOSTracks(esd->GetNumberOfPHOSParticles());
       evTag->SetNumOfEMCALTracks(esd->GetNumberOfEMCALParticles());
-      evTag->SetNumOfMuons(esd->GetNumberOfMuonTracks());
-    
+      
+      evTag->SetTotalMomentum(TotalP);
+      evTag->SetMeanPt(MeanPt);
+      evTag->SetMaxPt(MaxPt);
+  
       tag->AddEventTag(evTag);
     }
   lastEvent = i_NumberOfEvents;
index 5f7ec07a3127a29b22d2046837cc13906c015b58..aef41dbf5c25e2a6078a47c95fad30a524b04c26 100644 (file)
@@ -88,7 +88,8 @@ class AliRunTag : public TObject
 
   Int_t         GetNEvents() const {return fNumEvents;}
   
-  AliLHCTag    *GetLHCTag() { return &fLHCTag; }
+  AliLHCTag    *GetLHCTag() { return &fLHCTag; } 
+  TClonesArray *GetEventTags() const {return fEventTag;}
 
   ClassDef(AliRunTag,1)  //(ClassName, ClassVersion)
 };