]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
-add variables HasCocktailMother,HasCocktailGrandMother to indentify/cut on enhanced...
authorjbook <jbook@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Nov 2012 13:33:10 +0000 (13:33 +0000)
committerjbook <jbook@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Nov 2012 13:33:10 +0000 (13:33 +0000)
-add Print function to EventCuts

PWGDQ/dielectron/AliDielectronEventCuts.cxx
PWGDQ/dielectron/AliDielectronEventCuts.h
PWGDQ/dielectron/AliDielectronMC.cxx
PWGDQ/dielectron/AliDielectronMC.h
PWGDQ/dielectron/AliDielectronVarManager.cxx
PWGDQ/dielectron/AliDielectronVarManager.h

index 0699b582b90a6f8351cace580931b04e2d035148..a9f5067390adb3ffa984bb372cba8e1a1422a643 100644 (file)
@@ -38,6 +38,8 @@ Detailed description
 
 ClassImp(AliDielectronEventCuts)
 
+const char* AliDielectronEventCuts::fgkVtxNames[AliDielectronEventCuts::kVtxTracksOrSPD+1] = {"Tracks", "SPD", "TPC", "Any", "TracksOrSPD"};
+
 AliDielectronEventCuts::AliDielectronEventCuts() :
   AliAnalysisCuts(),
   fVtxZmin(0.),
@@ -257,3 +259,29 @@ Bool_t AliDielectronEventCuts::IsSelectedAOD(TObject* event)
   return kTRUE;
 }
 
+//________________________________________________________________________
+void AliDielectronEventCuts::Print(const Option_t* /*option*/) const
+{
+  //
+  // Print cuts and the range
+  //
+  printf("cut ranges for '%s'\n",GetTitle());
+  printf("All Cuts have to be fulfilled\n");
+
+  Int_t iCut=0;
+  if(fRequireVtx) {
+    printf("Cut %02d: vertex required \n",iCut);                                   iCut++; }
+  printf("Cut %02d: vertex type: %s \n", iCut, fgkVtxNames[fVtxType]);             iCut++;
+  if(fMinVtxContributors) {
+    printf("Cut %02d: vertex contributors >= %d \n", iCut, fMinVtxContributors);   iCut++; }
+  if(fVtxZmin<fVtxZmax) {
+    printf("Cut %02d: %f < %s < %f\n",     iCut, fVtxZmin, "Zvtx", fVtxZmax);      iCut++;}
+  if(fCentMin<fCentMax) {
+    printf("Cut %02d: %f < %s < %f\n",   iCut, fCentMin, "V0centrality", fCentMax);iCut++; }
+  if(fMultITSTPC) {
+    printf("Cut %02d: cut on multiplcity ITS vs. TPC \n", iCut);                   iCut++; }
+  if(fRequireV0and) {
+    printf("Cut %02d: require V0and type: %c \n", iCut, fRequireV0and);            iCut++; }
+
+}
+
index 28a39ea72142a50206f260ef756b74daf16d94e8..dd0d1be1d4cfc578b36547b24d31c3df36632e3e 100644 (file)
@@ -49,10 +49,11 @@ public:
   Bool_t IsSelectedESD(TObject* event);
   Bool_t IsSelectedAOD(TObject* event);
   virtual Bool_t IsSelected(TList*   /* list */ ) {return kFALSE;}
-  
 
-private:
+  void Print(const Option_t* option = "") const;
 
+private:
+  static const char* fgkVtxNames[AliDielectronEventCuts::kVtxTracksOrSPD+1];  //vertex names
   Double_t fVtxZmin;                // minimum z vertex position
   Double_t fVtxZmax;                // maximum z vertex position
   Bool_t   fRequireVtx;             // require a vertex
index 01f7f6a65a5a9aadfdc4f4b812f91b0cac75bf26..61c0710f201da869ea3475fce8bdea6f54b4f714 100644 (file)
@@ -664,10 +664,12 @@ Int_t AliDielectronMC::GetMothersLabel(Int_t daughterLabel) const {
   if(daughterLabel<0) return -1;
   if (fAnaType==kAOD) {
     if(!fMcArray) return -1;
-    return (static_cast<AliAODMCParticle*>(GetMCTrackFromMCEvent(daughterLabel)))->GetMother();
+    if(GetMCTrackFromMCEvent(daughterLabel))
+      return (static_cast<AliAODMCParticle*>(GetMCTrackFromMCEvent(daughterLabel)))->GetMother();
   } else if(fAnaType==kESD) {
     if (!fMCEvent) return -1;
-    return (static_cast<AliMCParticle*>(GetMCTrackFromMCEvent(daughterLabel)))->GetMother();
+    if(GetMCTrackFromMCEvent(daughterLabel))
+      return (static_cast<AliMCParticle*>(GetMCTrackFromMCEvent(daughterLabel)))->GetMother();
   }
   return -1;
 }
index 77e5744c8f9d1c2ee4b634111c9af9fef753ba1b..0fa61d1938cfc22bb9056544d022c15209d83947 100644 (file)
@@ -95,6 +95,7 @@ public:
   void GetDaughters(const TObject *mother, AliVParticle* &d1, AliVParticle* &d2);
   Int_t IsJpsiPrimary(const AliDielectronPair * pair);
   Int_t IsJpsiPrimary(const AliVParticle * pair);
+  Bool_t CheckParticleSource(Int_t label, AliDielectronSignalMC::ESource source) const;
 
   AliMCEvent* GetMCEvent() { return fMCEvent; }         // return the AliMCEvent
   
@@ -119,7 +120,6 @@ private:
   Int_t GetLabelMotherWithPdgAOD(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
   
   Bool_t ComparePDG(Int_t particlePDG, Int_t requiredPDG, Bool_t pdgExclusion, Bool_t checkBothCharges) const;
-  Bool_t CheckParticleSource(Int_t label, AliDielectronSignalMC::ESource source) const;
   Bool_t CheckIsRadiative(Int_t label) const;
   Bool_t CheckRadiativeDecision(Int_t mLabel, const AliDielectronSignalMC * const signalMC) const;
 
index 3b33a6d258734797d883d367cc40060e3879d58d..89619b9541a50e8b1e944e6e47070eb6553b921a 100644 (file)
@@ -79,6 +79,9 @@ const char* AliDielectronVarManager::fgkParticleNames[AliDielectronVarManager::k
   "PdgCode",
   "PdgCodeMother",
   "PdgCodeGrandMother",
+  "HasCocktailMother",
+  "HasCocktailGrandMother",
+
   "NumberOfDaughters",
   "HaveSameMother",
   "IsJpsiPrimary",
index 8d04ac14d4f9deb0d7eb81c2ce2ab7df1bab01b2..a35e3ff7a8ccb9b2d5cad1521b44dda543f16964 100644 (file)
@@ -123,6 +123,8 @@ public:
     kPdgCode,                // PDG code
     kPdgCodeMother, 
     kPdgCodeGrandMother,     // PDG code of the grandmother
+    kHasCocktailMother,      // true if particle is added via MC generator cocktail (AliDielectronSignal::kDirect)
+    kHasCocktailGrandMother, // true if particle is added via MC generator cocktail (AliDielectronSignal::kDirect)
     kNumberOfDaughters,      // number of daughters
     kHaveSameMother,         // check that particles have the same mother (MC)
     kIsJpsiPrimary,          // check if the particle is primary (MC)
@@ -547,18 +549,24 @@ inline void AliDielectronVarManager::FillVarESDtrack(const AliESDtrack *particle
   values[AliDielectronVarManager::kPdgCode]=-1;
   values[AliDielectronVarManager::kPdgCodeMother]=-1;
   values[AliDielectronVarManager::kPdgCodeGrandMother]=-1;
+  values[AliDielectronVarManager::kHasCocktailMother]=0;
+  values[AliDielectronVarManager::kHasCocktailGrandMother]=0;
   
   values[AliDielectronVarManager::kNumberOfDaughters]=-999;
   
   AliDielectronMC *mc=AliDielectronMC::Instance();
   
   if (mc->HasMC()){
-    if (mc->GetMCTrack(particle))
+    if (mc->GetMCTrack(particle)) {
       values[AliDielectronVarManager::kPdgCode]=mc->GetMCTrack(particle)->PdgCode();
-    
+      Int_t trkLbl = mc->GetMCTrack(particle)->GetLabel();
+      values[AliDielectronVarManager::kHasCocktailMother]=mc->CheckParticleSource(trkLbl, AliDielectronSignalMC::kDirect);
+    }
     AliMCParticle *motherMC=mc->GetMCTrackMother(particle); //mother
     if (motherMC){
       values[AliDielectronVarManager::kPdgCodeMother]=motherMC->PdgCode();
+      Int_t motherLbl = motherMC->GetLabel();
+      values[AliDielectronVarManager::kHasCocktailGrandMother]=mc->CheckParticleSource(motherLbl, AliDielectronSignalMC::kDirect);
       
       motherMC=mc->GetMCTrackMother(motherMC);  //grand motherMC
       if (motherMC) values[AliDielectronVarManager::kPdgCodeGrandMother]=motherMC->PdgCode();;
@@ -866,19 +874,26 @@ inline void AliDielectronVarManager::FillVarAODTrack(const AliAODTrack *particle
   values[AliDielectronVarManager::kPdgCode]=-1;
   values[AliDielectronVarManager::kPdgCodeMother]=-1;
   values[AliDielectronVarManager::kPdgCodeGrandMother]=-1;
-  
+  values[AliDielectronVarManager::kHasCocktailMother]=0;
+  values[AliDielectronVarManager::kHasCocktailGrandMother]=0;
+
   values[AliDielectronVarManager::kNumberOfDaughters]=-1;
   
   AliDielectronMC *mc=AliDielectronMC::Instance();
   
   if (mc->HasMC()){
-    if (mc->GetMCTrack(particle))
+    if (mc->GetMCTrack(particle)) {
       values[AliDielectronVarManager::kPdgCode]=mc->GetMCTrack(particle)->PdgCode();
-    
+      Int_t trkLbl = mc->GetMCTrack(particle)->GetLabel();
+      //      printf("trklbl %d for %p->%p \n",trkLbl,particle,mc->GetMCTrack(particle));
+      values[AliDielectronVarManager::kHasCocktailMother]=mc->CheckParticleSource(trkLbl, AliDielectronSignalMC::kDirect);
+    }
     AliAODMCParticle *motherMC=mc->GetMCTrackMother(particle); //mother
     if (motherMC){
       values[AliDielectronVarManager::kPdgCodeMother]=motherMC->PdgCode();
-      
+      Int_t motherLbl = motherMC->GetLabel();
+      values[AliDielectronVarManager::kHasCocktailGrandMother]=mc->CheckParticleSource(motherLbl, AliDielectronSignalMC::kDirect);
+     
       motherMC=mc->GetMCTrackMother(motherMC);  //grand motherMC
       if (motherMC) values[AliDielectronVarManager::kPdgCodeGrandMother]=motherMC->PdgCode();;
     }
@@ -932,7 +947,9 @@ inline void AliDielectronVarManager::FillVarMCParticle(const AliMCParticle *part
   values[AliDielectronVarManager::kPdgCode]       = -1;
   values[AliDielectronVarManager::kPdgCodeMother] = -1;
   values[AliDielectronVarManager::kPdgCodeGrandMother] = -1;
-  
+  values[AliDielectronVarManager::kHasCocktailMother]=0;
+  values[AliDielectronVarManager::kHasCocktailGrandMother]=0;
+
   // Fill common AliVParticle interface information
   FillVarVParticle(particle, values);
   
@@ -940,10 +957,15 @@ inline void AliDielectronVarManager::FillVarMCParticle(const AliMCParticle *part
 
   // Fill AliMCParticle interface specific information
   values[AliDielectronVarManager::kPdgCode] = particle->PdgCode();
+  Int_t trkLbl = particle->GetLabel();
+  values[AliDielectronVarManager::kHasCocktailMother]=mc->CheckParticleSource(trkLbl, AliDielectronSignalMC::kDirect);
 
   AliMCParticle *motherMC = mc->GetMCTrackMother(particle);
   if (motherMC){
     values[AliDielectronVarManager::kPdgCodeMother]=motherMC->PdgCode();
+    Int_t motherLbl = motherMC->GetLabel();
+    values[AliDielectronVarManager::kHasCocktailGrandMother]=mc->CheckParticleSource(motherLbl, AliDielectronSignalMC::kDirect);
+
     motherMC=mc->GetMCTrackMother(motherMC);  //grand mother
     if (motherMC) values[AliDielectronVarManager::kPdgCodeGrandMother]=motherMC->PdgCode();;
   }
@@ -992,6 +1014,7 @@ inline void AliDielectronVarManager::FillVarMCParticle2(const AliVParticle *p1,
   
   values[AliDielectronVarManager::kPdgCode]       = 0;
   values[AliDielectronVarManager::kPdgCodeMother] = 0;
+  values[AliDielectronVarManager::kHasCocktailMother]=0;
 
   AliDielectronMC *mc=AliDielectronMC::Instance();
   AliVParticle* mother=0x0;
@@ -1090,7 +1113,9 @@ inline void AliDielectronVarManager::FillVarAODMCParticle(const AliAODMCParticle
   values[AliDielectronVarManager::kPdgCode]       = -1;
   values[AliDielectronVarManager::kPdgCodeMother] = -1;
   values[AliDielectronVarManager::kPdgCodeGrandMother] = -1;
-  
+  values[AliDielectronVarManager::kHasCocktailMother]=0;
+  values[AliDielectronVarManager::kHasCocktailGrandMother]=0;
+
   // Fill common AliVParticle interface information
   FillVarVParticle(particle, values);
   
@@ -1099,10 +1124,15 @@ inline void AliDielectronVarManager::FillVarAODMCParticle(const AliAODMCParticle
 
   // Fill AliAODMCParticle interface specific information
   values[AliDielectronVarManager::kPdgCode] = particle->PdgCode();
+  Int_t trkLbl = particle->GetLabel();
+  values[AliDielectronVarManager::kHasCocktailMother]=mc->CheckParticleSource(trkLbl, AliDielectronSignalMC::kDirect);
 
   AliAODMCParticle *motherMC = mc->GetMCTrackMother(particle);
   if (motherMC){
     values[AliDielectronVarManager::kPdgCodeMother]=motherMC->PdgCode();
+    Int_t motherLbl = motherMC->GetLabel();
+    values[AliDielectronVarManager::kHasCocktailGrandMother]=mc->CheckParticleSource(motherLbl, AliDielectronSignalMC::kDirect);
+
     motherMC=mc->GetMCTrackMother(motherMC);  //grand mother
     if (motherMC) values[AliDielectronVarManager::kPdgCodeGrandMother]=motherMC->PdgCode();;
   }
@@ -1122,7 +1152,8 @@ inline void AliDielectronVarManager::FillVarDielectronPair(const AliDielectronPa
   values[AliDielectronVarManager::kPdgCode]=-1;
   values[AliDielectronVarManager::kPdgCodeMother]=-1;
   values[AliDielectronVarManager::kPdgCodeGrandMother]=-1;
-  
+  values[AliDielectronVarManager::kHasCocktailMother]=0;
+  values[AliDielectronVarManager::kHasCocktailGrandMother]=0;
   
   Double_t errPseudoProperTime2 = -1;
   // Fill common AliVParticle interface information
@@ -1321,7 +1352,7 @@ inline void AliDielectronVarManager::FillVarDielectronPair(const AliDielectronPa
     values[AliDielectronVarManager::kIsJpsiPrimary] = mc->IsJpsiPrimary(pair);
     values[AliDielectronVarManager::kHaveSameMother] = samemother ;
 
-      // fill kPseudoProperTimeResolution
+    // fill kPseudoProperTimeResolution
     values[AliDielectronVarManager::kPseudoProperTimeResolution] = -1e10;
     // values[AliDielectronVarManager::kPseudoProperTimePull] = -1e10;
     if(samemother && fgEvent) {
@@ -1331,13 +1362,15 @@ inline void AliDielectronVarManager::FillVarDielectronPair(const AliDielectronPa
         const AliMCEvent *mcevent = mc->GetMCEvent();
        const AliVVertex* mcVtx = mcevent ? mcevent->GetPrimaryVertex() : 0x0;
        if(motherMC && mcVtx) {
-         const Double_t lxyMC = ( (motherMC->Xv() - mcVtx->GetX()) * motherMC->Px() +
+         Int_t motherLbl = motherMC->GetLabel();
+         values[AliDielectronVarManager::kHasCocktailMother]=mc->CheckParticleSource(motherLbl, AliDielectronSignalMC::kDirect);
+         const Double_t lxyMC = ( (motherMC->Xv() - mcVtx->GetX()) * motherMC->Px() +
                                    (motherMC->Yv() - mcVtx->GetY()) * motherMC->Py()   ) / motherMC->Pt();
          const Double_t pseudoMC = lxyMC * (TDatabasePDG::Instance()->GetParticle(443)->Mass())/motherMC->Pt();
          values[AliDielectronVarManager::kPseudoProperTimeResolution] = values[AliDielectronVarManager::kPseudoProperTime] - pseudoMC;
           if (errPseudoProperTime2 > 0)
             values[AliDielectronVarManager::kPseudoProperTimePull] = values[AliDielectronVarManager::kPseudoProperTimeResolution]/sqrt(errPseudoProperTime2);
-       }
+      }
       }
     }
     
@@ -1418,7 +1451,8 @@ inline void AliDielectronVarManager::FillVarKFParticle(const AliKFParticle *part
   values[AliDielectronVarManager::kPdgCode]       = -1;
   values[AliDielectronVarManager::kPdgCodeMother] = -1;
   values[AliDielectronVarManager::kPdgCodeGrandMother] = -1;
-  
+  values[AliDielectronVarManager::kHasCocktailMother]=0;
+  values[AliDielectronVarManager::kHasCocktailGrandMother]=0;
   
 //   if ( fgEvent ) AliDielectronVarManager::Fill(fgEvent, values);
   for (Int_t i=AliDielectronVarManager::kPairMax; i<AliDielectronVarManager::kNMaxValues; ++i)