]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Modified action ocut on primary vertex, removed some useless printouts
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 1 Aug 2010 16:06:01 +0000 (16:06 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 1 Aug 2010 16:06:01 +0000 (16:06 +0000)
PWG2/RESONANCES/AliRsnAnalysisSE.cxx
PWG2/RESONANCES/AliRsnCutPrimaryVertex.cxx
PWG2/RESONANCES/AliRsnCutPrimaryVertex.h
PWG2/RESONANCES/macros/test/ConfigTaskRsn2010.C

index cce2d73c6ca85ab112706d2ec2bde5bc61f6d25e..6483face6d02256aed1faeb4b3b04b3b738beeb5 100644 (file)
@@ -68,9 +68,6 @@ void AliRsnAnalysisSE::RsnUserCreateOutputObjects()
 
   fOutList = new TList;
   fRsnAnalysisManager.InitAllPairs(fOutList);
-  
-  AliError("\n\n***LIST***\n\n");
-  fOutList->Print();
 
   PostData(2, fOutList);
 
index 694b252f935cd54ce5d7fe099766158ed8f83d86..8b8dc5393fd2de5d36031601c79e168a9854c304 100644 (file)
@@ -24,7 +24,7 @@ AliRsnCutPrimaryVertex::AliRsnCutPrimaryVertex() :
 
 //_________________________________________________________________________________________________
 AliRsnCutPrimaryVertex::AliRsnCutPrimaryVertex
-(const char *name, Int_t nContributors, Bool_t acceptTPC) :
+(const char *name, Double_t maxVz, Int_t nContributors, Bool_t acceptTPC) :
   AliRsnCut(name, AliRsnCut::kEvent, 0, nContributors - 1),
   fAcceptTPC(acceptTPC)
 {
@@ -42,6 +42,9 @@ AliRsnCutPrimaryVertex::AliRsnCutPrimaryVertex
 // Since the range check uses the '>=' and '<=', the high edge
 // must be decreased by 1 to get the right behaviour, since this is integer.
 //
+
+  fMinD = 0.0;
+  fMaxD = maxVz;
 }
 
 //_________________________________________________________________________________________________
@@ -55,42 +58,44 @@ Bool_t AliRsnCutPrimaryVertex::IsSelected(TObject *obj1, TObject* /*obj2*/)
   AliRsnEvent *rsn = dynamic_cast<AliRsnEvent*>(obj1);
   if (!rsn) return kFALSE;
   AliESDEvent *esd = dynamic_cast<AliESDEvent*>(rsn->GetRef());
-  if (!esd) {
+  if (!esd) 
+  {
     AliDebug(AliLog::kDebug+2, "NO ESD");
     return kFALSE;
   }
 
-  // get the three possible primary vertexes of the event:
-  // 0 = default one
-  // 1 = SPD
-  // 2 = TPC
-  // then, if the default vertex is TPC, the event is rejected,
-  // otherwise, the event is rejected only if its vertex status is 'false'
-  // get primary vertexes
-  const AliESDVertex *vert[3];
-  vert[0] = esd->GetPrimaryVertex();
-  vert[1] = esd->GetPrimaryVertexSPD();
-  vert[2] = esd->GetPrimaryVertexTPC();
-
-  // if TPC vertexes are rejected by default do this now
-  if (!fAcceptTPC && (vert[0] == vert[2])) {
-    AliDebug(AliLog::kDebug+2, "Rejecting TPC vertex");
-    return kFALSE;
+  // get the best primary vertex:
+  // first try the one with tracks
+  const AliESDVertex *vTrk  = esd->GetPrimaryVertexTracks();
+  const AliESDVertex *vSPD  = esd->GetPrimaryVertexSPD();
+  const AliESDVertex *vTPC  = esd->GetPrimaryVertexTPC();
+  Double_t            vzTrk = 2.0 * fMaxD;
+  Double_t            vzSPD = 2.0 * fMaxD;
+  Double_t            vzTPC = 2.0 * fMaxD;
+  if (vTrk) vzTrk = TMath::Abs(vTrk->GetZv());
+  if (vSPD) vzSPD = TMath::Abs(vSPD->GetZv());
+  if (vTPC) vzTPC = TMath::Abs(vTPC->GetZv());
+  AliDebug(AliLog::kDebug + 1, Form("Vertex with tracks: contributors = %d, abs(vz) = %f", vTrk->GetNContributors(), vzTrk));
+  AliDebug(AliLog::kDebug + 1, Form("Vertex with SPD,    contributors = %d, abs(vz) = %f", vSPD->GetNContributors(), vzSPD));
+  AliDebug(AliLog::kDebug + 1, Form("Vertex with TPC,    contributors = %d, abs(vz) = %f", vTPC->GetNContributors(), vzTPC));
+  if(vTrk->GetStatus())
+  {
+    fCutValueI = vTrk->GetNContributors();
+    fCutValueD = vzTrk;
   }
-
-  // if we are here, vert[0] contains the default primary vertex
-  // in case it is with tracks or SPD, its status must be OK
-  // because otherwise the ESD event returns the lower level vertex
-  // then, we can check just the first element in the array
-  if (!vert[0]->GetStatus()) {
-    AliDebug(AliLog::kDebug+2, "Bad vertex status");
-    return kFALSE;
+  else if (vSPD->GetStatus())
+  {
+    fCutValueI = vSPD->GetNContributors();
+    fCutValueD = vzSPD;
   }
-
-  // if we are here, the status of default vertex is OK
-  // and then we check the number of contributors:
-  // it must be *outside* the 'allowed' range
-  fCutValueI = vert[0]->GetNContributors();
-  return /*there is a NOT operator */!/*here*/OkRange();
+  else if (vTPC->GetStatus() && fAcceptTPC)
+  {
+    fCutValueI = vTPC->GetNContributors();
+    fCutValueD = vzTPC;
+  }
+  else
+    return kFALSE;
+  
+  return OkRangeI() && OkRangeD();
 }
 
index 3a8826606f21e4557f5ca0e9fc575904740dd865..7606d6f7be39d99cffbb86491d78a8e96d6d1c5d 100644 (file)
@@ -31,7 +31,7 @@ class AliRsnCutPrimaryVertex : public AliRsnCut
   public:
 
     AliRsnCutPrimaryVertex();
-    AliRsnCutPrimaryVertex(const char *name, Int_t minContributors, Bool_t acceptTPC = kFALSE);
+    AliRsnCutPrimaryVertex(const char *name, Double_t maxVz, Int_t minContributors = 0, Bool_t acceptTPC = kFALSE);
     virtual ~AliRsnCutPrimaryVertex() {;};
 
     virtual Bool_t IsSelected(TObject *obj1, TObject *obj2 = 0x0);
index f575c29dd28103a62f111c44b9180df864bbfa87..9a61a63c089fbbaf44ac711483e3ec3b27462924 100644 (file)
@@ -52,10 +52,14 @@ Bool_t RsnConfigTask(AliRsnAnalysisSE* &task, const char *dataLabel)
   AliRsnPairDef         *pairDefMM = new AliRsnPairDef(AliPID::kKaon, '-', AliPID::kKaon, '-', 333, 1.019455);
 
   // computation objects
-  AliRsnPairNtuple      *pairPM = new AliRsnPairNtuple("PairPM" , pairDefPM);
-  AliRsnPairNtuple      *truePM = new AliRsnPairNtuple("TruePM" , pairDefPM);
-  AliRsnPairNtuple      *pairPP = new AliRsnPairNtuple("PairPP" , pairDefPP);
-  AliRsnPairNtuple      *pairMM = new AliRsnPairNtuple("PairMM" , pairDefMM);
+  //AliRsnPairNtuple      *pairPM = new AliRsnPairNtuple("PairPM" , pairDefPM);
+  //AliRsnPairNtuple      *truePM = new AliRsnPairNtuple("TruePM" , pairDefPM);
+  //AliRsnPairNtuple      *pairPP = new AliRsnPairNtuple("PairPP" , pairDefPP);
+  //AliRsnPairNtuple      *pairMM = new AliRsnPairNtuple("PairMM" , pairDefMM);
+  AliRsnPairFunctions    *pairPM = new AliRsnPairNtuple("PairPM" , pairDefPM);
+  AliRsnPairFunctions    *truePM = new AliRsnPairNtuple("TruePM" , pairDefPM);
+  AliRsnPairFunctions    *pairPP = new AliRsnPairNtuple("PairPP" , pairDefPP);
+  AliRsnPairFunctions    *pairMM = new AliRsnPairNtuple("PairMM" , pairDefMM);
 
   //
   // -- Setup cuts ----------------------------------------------------------------------------------
@@ -138,24 +142,37 @@ Bool_t RsnConfigTask(AliRsnAnalysisSE* &task, const char *dataLabel)
   //
   
   // function axes
-  AliRsnValue *axisIM   = new AliRsnValue(AliRsnValue::kPairInvMass,   50,  0.9,  1.4);
-  AliRsnValue *axisPt   = new AliRsnValue(AliRsnValue::kPairPt,        50,  0.0, 10.0);
-  AliRsnValue *axisEta  = new AliRsnValue(AliRsnValue::kPairEta,       30, -1.5,  1.5);
+  AliRsnValue *axisIM = new AliRsnValue(AliRsnValue::kPairInvMass,   4000,  0.9,  4.9);
+  AliRsnValue *axisPt = new AliRsnValue(AliRsnValue::kPairPt,         100,  0.0, 10.0);
+  AliRsnValue *axisY  = new AliRsnValue(AliRsnValue::kPairY,           30, -1.5,  1.5);
   
   // the ntuple output requires to get directly the values
-  pairPM->AddValue(axisIM);
-  pairPM->AddValue(axisPt);
-  pairPM->AddValue(axisEta);
-  truePM->AddValue(axisIM);
-  truePM->AddValue(axisPt);
-  truePM->AddValue(axisEta);
-  pairPP->AddValue(axisIM);
-  pairPP->AddValue(axisPt);
-  pairPP->AddValue(axisEta);
-  pairMM->AddValue(axisIM);
-  pairMM->AddValue(axisPt);
-  pairMM->AddValue(axisEta);
-
+  //pairPM->AddValue(axisIM);
+  //pairPM->AddValue(axisPt);
+  //pairPM->AddValue(axisEta);
+  //truePM->AddValue(axisIM);
+  //truePM->AddValue(axisPt);
+  //truePM->AddValue(axisEta);
+  //pairPP->AddValue(axisIM);
+  //pairPP->AddValue(axisPt);
+  //pairPP->AddValue(axisEta);
+  //pairMM->AddValue(axisIM);
+  //pairMM->AddValue(axisPt);
+  //pairMM->AddValue(axisEta);
+  
+  // functions
+  AliRsnFunction *fcnImPtY = new AliRsnFunction;
+  // --> add axes
+  fcnImPtY->AddAxis(axisIM);
+  fcnImPtY->AddAxis(axisPt);
+  fcnImPtY->AddAxis(axisEta);
+  
+  // add functions to pairs
+  pairPM->AddFunction(fcnImPtY);
+  truePM->AddFunction(fcnImPtY);
+  pairPP->AddFunction(fcnImPtY);
+  pairMM->AddFunction(fcnImPtY);
+  
   //
   // -- Conclusion ----------------------------------------------------------------------------------
   //