]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add flag to switch on multiplicity calculation in ITS Vertexers (to be used in the...
authorprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Jun 2010 13:54:04 +0000 (13:54 +0000)
committerprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Jun 2010 13:54:04 +0000 (13:54 +0000)
ITS/AliITSMeanVertexer.cxx
ITS/AliITSVertexer.cxx
ITS/AliITSVertexer.h
ITS/AliITSVertexer3D.cxx
ITS/AliITSVertexerCosmics.cxx
ITS/AliITSVertexerZ.cxx
ITS/DoVerticesSPD.C

index 69107cfe210e314d69abcc211e74f8d58180d3ef..b4ccaab9378e70e6bb2688807acda76f377f26a6 100644 (file)
@@ -134,6 +134,7 @@ Bool_t AliITSMeanVertexer::Reconstruct(AliRawReader *rawReader, Bool_t mode){
   // Run standard vertexer3d
     AliITSVertexer3D *vertexer2 = new AliITSVertexer3D();
     vertexer2->SetDetTypeRec(fDetTypeRec);
+    vertexer2->SetComputeMultiplicity(kTRUE);
     vtx = vertexer2->FindVertexForCurrentEvent(clustersTree);
     AliMultiplicity *mult = vertexer2->GetMultiplicity();
     delete vertexer2;
index ddcd63049c7310638d1a089babb205a5cc08802f..0944a9b84346c0e485514001c68100cd57e11a0d 100644 (file)
@@ -23,6 +23,7 @@ ClassImp(AliITSVertexer)
 AliITSVertexer::AliITSVertexer():AliVertexer(),
 fLadders(), 
 fLadOnLay2(0),
+fComputeMultiplicity(kFALSE),
 fDetTypeRec(NULL),
 fMinTrackletsForPilup(0),
 fIsPileup(0),
index 23773f983e06e71586ae4c4fcf9830f748c7cdf5..74856063237c06c34e3f092094c1d9cbf12a135f 100644 (file)
@@ -29,9 +29,10 @@ class AliITSVertexer : public AliVertexer {
     void SetLastEvent(Int_t ev){fLastEvent = ev;}
     static Float_t GetPipeRadius() {return fgkPipeRadius;}
     void SetLaddersOnLayer2(Int_t ladwid=4);
+    void SetComputeMultiplicity(Bool_t opt=kTRUE){fComputeMultiplicity=opt;}
     virtual void SetUseModule(Int_t imod, Bool_t optUse){
       if(imod>=0 && imod<kNSPDMod) fUseModule[imod]=optUse;
-    }
+    }    
     virtual Bool_t IsModuleUsed(Int_t imod) const {
       if(imod>=0 && imod<kNSPDMod) return fUseModule[imod];
       else return 0;
@@ -64,6 +65,7 @@ class AliITSVertexer : public AliVertexer {
     UShort_t *fLadders; // array with layer1-layer2 ladders correspondances  
     Int_t fLadOnLay2;   // (2*fLadOnLay2+1)=number of layer2 ladders 
                       // associated to a layer1 ladder
+    Bool_t  fComputeMultiplicity;      // flag to switch on/off tracklet calculation
     Bool_t  fUseModule[kNSPDMod]; // flag for enabling/disabling SPD modules
     AliITSDetTypeRec *fDetTypeRec;  //! pointer to DetTypeRec
     Int_t fMinTrackletsForPilup;  // min. n. of tracklets for pilup definition
@@ -83,7 +85,7 @@ class AliITSVertexer : public AliVertexer {
     Int_t fFirstEvent;          // First event to be processed by FindVertices
     Int_t fLastEvent;           // Last event to be processed by FindVertices
 
-  ClassDef(AliITSVertexer,10);
+  ClassDef(AliITSVertexer,11);
 };
 
 #endif
index bccbc54ce4701d1f45d9375ed0b855365cb5fcbc..176aa9b8766d69fb6b1562c3862361f20dd91755 100644 (file)
@@ -150,9 +150,8 @@ AliESDVertex* AliITSVertexer3D::FindVertexForCurrentEvent(TTree *itsClusterTree)
       delete vtxz;
     }
 
-  }
-  //RS
-  //  FindMultiplicity(itsClusterTree);
+  }  
+  if(fComputeMultiplicity) FindMultiplicity(itsClusterTree);
   return fCurrentVertex;
 }  
 
index c3c629e769866e25fb79acfb8cea6076e8142dfc..e1ded3369ff3e35c56bef54dccced060ef7b86c5 100644 (file)
@@ -309,8 +309,7 @@ AliESDVertex* AliITSVertexerCosmics::FindVertexForCurrentEvent(TTree *itsCluster
   fCurrentVertex->SetTitle("cosmics fake vertex");
   fCurrentVertex->SetNContributors(ncontributors);
   //fCurrentVertex->Print();
-  // RS
-  // FindMultiplicity(itsClusterTree);
+  if(fComputeMultiplicity) FindMultiplicity(itsClusterTree);
 
   delete recpoints;
 
index b5d33681f92aa695529ac9425faead6d7d8af9a3..30bd95555982f9029309ec062891c814c5e2db12 100644 (file)
@@ -180,8 +180,7 @@ AliESDVertex* AliITSVertexerZ::FindVertexForCurrentEvent(TTree *itsClusterTree){
       fDiffPhiMax=diffPhiMaxOrig;
     }
   }
-  //RS
-  //  FindMultiplicity(itsClusterTree);
+  if(fComputeMultiplicity) FindMultiplicity(itsClusterTree);
   return fCurrentVertex;
 }  
 
index 616e294109a7f7fc60b71d62ecd36a49244edf5d..8dd5c26d515cfaba32fb9680a1fc1d9f4cb9888e 100644 (file)
@@ -30,7 +30,7 @@
 
 /*  $Id$    */
 
-Bool_t DoVerticesSPD(Int_t pileupalgo=1, Int_t optdebug=0){
+Bool_t DoVerticesSPD(Bool_t isMC=kFALSE, Int_t pileupalgo=1, Int_t optdebug=0){
 
   TFile *fint = new TFile("VertexSPD.root","recreate");
   TNtuple *nt = new TNtuple("ntvert","vertices","xtrue:ytrue:ztrue:zZ:zdiffZ:zerrZ:ntrksZ:x3D:xdiff3D:xerr3D:y3D:ydiff3D:yerr3D:z3D:zdiff3D:zerr3D:ntrks3D:dndy:ntrklets:nrp1:ptyp:is3D:isTriggered");
@@ -62,14 +62,17 @@ Bool_t DoVerticesSPD(Int_t pileupalgo=1, Int_t optdebug=0){
          "galice.root");
     return kFALSE;
   }
-  runLoader->LoadgAlice();
-  gAlice = runLoader->GetAliRun();
-  if (!gAlice) {
-    Error("DoVertices", "no galice object found");
-    return kFALSE;
+  
+  if(isMC){
+    runLoader->LoadgAlice();
+    gAlice = runLoader->GetAliRun();
+    if (!gAlice) {
+      Error("DoVertices", "no galice object found");
+      return kFALSE;
+    }
+    runLoader->LoadKinematics();
+    runLoader->LoadHeader();
   }
-  runLoader->LoadKinematics();
-  runLoader->LoadHeader();
   AliITSLoader* ITSloader =  (AliITSLoader*) runLoader->GetLoader("ITSLoader");
   ITSloader->LoadRecPoints("read");
 
@@ -101,14 +104,14 @@ Bool_t DoVerticesSPD(Int_t pileupalgo=1, Int_t optdebug=0){
   Double_t xnom=0.,ynom=0.;
   AliITSVertexerZ *vertz = new AliITSVertexerZ(xnom,ynom);
   vertz->Init("default");
-  AliITSVertexer3D *vert3d = new AliITSVertexer3D();
+  AliITSVertexer3D *vert3d = new AliITSVertexer3D();  
   vert3d->Init("default");
   vert3d->SetWideFiducialRegion(40.,1.);
   vert3d->SetPileupAlgo(pileupalgo);
   vert3d->PrintStatus();
   vertz->SetDetTypeRec(detTypeRec);
   vert3d->SetDetTypeRec(detTypeRec);
-
+  vert3d->SetComputeMultiplicity(kTRUE);
   /* uncomment these lines to use diamond constrain */
 //   Double_t posdiam[3]={0.03,0.1,0.};
 //   Double_t sigdiam[3]={0.01,0.01,10.0};
@@ -126,32 +129,33 @@ Bool_t DoVerticesSPD(Int_t pileupalgo=1, Int_t optdebug=0){
   for (Int_t iEvent = 0; iEvent < totev; iEvent++) {
     TArrayF mcVertex(3); 
     runLoader->GetEvent(iEvent);
-    runLoader->GetHeader()->GenEventHeader()->PrimaryVertex(mcVertex);
-    AliGenPythiaEventHeader *evh=(AliGenPythiaEventHeader*)runLoader->GetHeader()->GenEventHeader();
-    Int_t ptype = evh->ProcessType();
+    Double_t dNchdy = 0.;
+    Int_t ptype = 0;
     if(optdebug){
       printf("==============================================================\n");
-      printf("\nEvent: %d ---- Process Type = %d \n",iEvent,ptype);
+      printf("Event: %d \n",iEvent);
     }
-
-    AliStack* stack = runLoader->Stack();
-    TTree *treek=(TTree*)runLoader->TreeK();
-    Int_t npart = (Int_t)treek->GetEntries();
-    if(optdebug) printf("particles  %d\n",npart);
-
-    Double_t dNchdy = 0.;
-
-   // loop on particles to get generated dN/dy
-    for(Int_t iPart=0; iPart<npart; iPart++) {
-      if(!stack->IsPhysicalPrimary(iPart)) continue;
-      TParticle* part = (TParticle*)stack->Particle(iPart);
-      if(part->GetPDG()->Charge() == 0) continue;
-      Double_t eta=part->Eta();
-
-      if(TMath::Abs(eta)<1.5) dNchdy+=1.; 
+    if(isMC){
+      runLoader->GetHeader()->GenEventHeader()->PrimaryVertex(mcVertex);
+      AliGenPythiaEventHeader *evh=(AliGenPythiaEventHeader*)runLoader->GetHeader()->GenEventHeader();
+      ptype = evh->ProcessType();
+
+      AliStack* stack = runLoader->Stack();
+      TTree *treek=(TTree*)runLoader->TreeK();
+      Int_t npart = (Int_t)treek->GetEntries();
+      if(optdebug) printf("Process Type = %d --- Particles  %d\n",ptype,npart);
+      
+      // loop on particles to get generated dN/dy
+      for(Int_t iPart=0; iPart<npart; iPart++) {
+       if(!stack->IsPhysicalPrimary(iPart)) continue;
+       TParticle* part = (TParticle*)stack->Particle(iPart);
+       if(part->GetPDG()->Charge() == 0) continue;
+       Double_t eta=part->Eta();
+       
+       if(TMath::Abs(eta)<1.5) dNchdy+=1.; 
+      }
+      if(optdebug) printf(" dNch/dy = %f\n",dNchdy);
     }
-    if(optdebug) printf(" dNch/dy = %f\n",dNchdy);
     tree->GetEvent(iEvent);
 
     TTree* cltree = ITSloader->TreeR();
@@ -167,7 +171,6 @@ Bool_t DoVerticesSPD(Int_t pileupalgo=1, Int_t optdebug=0){
       ntrklets=alimult->GetNumberOfTracklets() ;
       nrecp1=ntrklets+alimult->GetNumberOfSingleClusters();
     }
-       
 
 
     TDirectory *current = gDirectory;
@@ -251,8 +254,10 @@ Bool_t DoVerticesSPD(Int_t pileupalgo=1, Int_t optdebug=0){
     current->cd();
     
     if(optdebug){
-      printf("\nVertexerZ:  \tz(cm)=%9.5f \tTracklets=%d \tztrue(cm)=%9.5f \tzdiff(um)=%8.2f\n",zz,ntrkz,mcVertex[2],zdiffz);
-      printf("Vertexer3D: \tz(cm)=%9.5f \tTracklets=%d \tztrue(cm)=%9.5f \tzdiff(um)=%8.2f\n",z3d,ntrk3d,mcVertex[2],zdiff3d);
+      printf("Vertexer3D: \tx=%.5f \ty=%.5f \tz(cm)=%.5f \tContributors=%d \n",x3d,y3d,z3d,ntrk3d);
+      printf("VertexerZ:  \tx=%.5f \ty=%.5f \tz(cm)=%.5f \tContributors=%d \n",0.,0.,zz,ntrkz);
+      if(isMC) printf("True Pos.: \tx=%.5f \ty=%.5f \tz(cm)=%.5f \tdN/dy=%.1f\n",mcVertex[0],mcVertex[1],mcVertex[2],dNchdy);
+      printf("Multiplicity: Tracklets=%d  ClustersLay1=%d\n",ntrklets,nrecp1);
     }
     
   }