//------------------------------------------------------------
// Tries to find mother's labels
//------------------------------------------------------------
- Int_t nlabels =0;
- for (Int_t i=0;i<10;i++) if (lab[i]>=0) nlabels++;
- if(nlabels == 0) return; // In case of no labels just exit
+ AliRunLoader *rl = AliRunLoader::GetRunLoader();
+ TTree *trK=(TTree*)rl->TreeK();
+ if(trK){
+ Int_t nlabels =0;
+ for (Int_t i=0;i<10;i++) if (lab[i]>=0) nlabels++;
+ if(nlabels == 0) return; // In case of no labels just exit
- Int_t ntracks = gAlice->GetMCApp()->GetNtrack();
- for (Int_t i=0;i<10;i++){
- Int_t label = lab[i];
- if (label>=0 && label<ntracks) {
- TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
+ Int_t ntracks = gAlice->GetMCApp()->GetNtrack();
- if (part->P() < 0.02) {
+ for (Int_t i=0;i<10;i++){
+ Int_t label = lab[i];
+ if (label>=0 && label<ntracks) {
+ TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
+
+ if (part->P() < 0.02) {
Int_t m=part->GetFirstMother();
if (m<0) {
continue;
continue;
}
lab[i]=m;
+ }
+ else
+ if (part->P() < 0.12 && nlabels>3) {
+ lab[i]=-2;
+ nlabels--;
+ }
}
- else
- if (part->P() < 0.12 && nlabels>3) {
+ else{
+ if ( (label>ntracks||label <0) && nlabels>3) {
lab[i]=-2;
nlabels--;
}
- }
- else{
- if ( (label>ntracks||label <0) && nlabels>3) {
- lab[i]=-2;
- nlabels--;
- }
- }
- }
- if (nlabels>3){
- for (Int_t i=0;i<10;i++){
- if (nlabels>3){
- Int_t label = lab[i];
- if (label>=0 && label<ntracks) {
- TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
- if (part->P() < 0.1) {
- lab[i]=-2;
- nlabels--;
+ }
+ }
+ if (nlabels>3){
+ for (Int_t i=0;i<10;i++){
+ if (nlabels>3){
+ Int_t label = lab[i];
+ if (label>=0 && label<ntracks) {
+ TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
+ if (part->P() < 0.1) {
+ lab[i]=-2;
+ nlabels--;
+ }
}
}
}
}
- }
- //compress labels -- if multi-times the same
- Int_t lab2[10];
- for (Int_t i=0;i<10;i++) lab2[i]=-2;
- for (Int_t i=0;i<10 ;i++){
- if (lab[i]<0) continue;
- for (Int_t j=0;j<10 &&lab2[j]!=lab[i];j++){
- if (lab2[j]<0) {
- lab2[j]= lab[i];
- break;
+ //compress labels -- if multi-times the same
+ Int_t lab2[10];
+ for (Int_t i=0;i<10;i++) lab2[i]=-2;
+ for (Int_t i=0;i<10 ;i++){
+ if (lab[i]<0) continue;
+ for (Int_t j=0;j<10 &&lab2[j]!=lab[i];j++){
+ if (lab2[j]<0) {
+ lab2[j]= lab[i];
+ break;
+ }
}
}
- }
- for (Int_t j=0;j<10;j++) lab[j]=lab2[j];
+ for (Int_t j=0;j<10;j++) lab[j]=lab2[j];
+ }
}
//______________________________________________________________________
void AliITSClusterFinderV2::AddLabel(Int_t lab[10], Int_t label) {
-
//add label to the cluster
+ AliRunLoader *rl = AliRunLoader::GetRunLoader();
+ TTree *trK=(TTree*)rl->TreeK();
+ if(trK){
+ if(label<0) return; // In case of no label just exit
- if(label<0) return; // In case of no label just exit
-
- Int_t ntracks = gAlice->GetMCApp()->GetNtrack();
- if (label>ntracks) return;
- for (Int_t i=0;i<10;i++){
- // if (label<0) break;
- if (lab[i]==label) break;
- if (lab[i]<0) {
- lab[i]= label;
- break;
+ Int_t ntracks = gAlice->GetMCApp()->GetNtrack();
+ if (label>ntracks) return;
+ for (Int_t i=0;i<10;i++){
+ // if (label<0) break;
+ if (lab[i]==label) break;
+ if (lab[i]<0) {
+ lab[i]= label;
+ break;
+ }
}
}
}
#if !defined(__CINT__) || defined(__MAKECINT__)
-#include "Riostream.h"
-#include "TClassTable.h"
-#include "TDatime.h"
-#include "TStopwatch.h"
+#include <Riostream.h>
+#include <TClassTable.h>
+#include <TDatime.h>
+#include <TGeoManager.h>
+#include <TROOT.h>
+#include <TStopwatch.h>
#include "AliRun.h"
#include "AliRunDigitizer.h"
+#include "AliITSDetTypeRec.h"
#include "AliITSDigitizer.h"
#include "AliITS.h"
-#include "AliITSDetType.h"
#include "AliITSresponseSDD.h"
#include "AliITSreconstruction.h"
#define DEBUG
Int_t AliITSDigits2RecPoints(TString filename="galice.root",TString fileRP=""){
- // Standard ITS Digits to RecPoints.
+ // Standard ITS Digits to RecPoints.
- // Dynamically link some shared libs
- if (gClassTable->GetID("AliRun") < 0) {
- gROOT->ProcessLine(".x $(ALICE_ROOT)/macros/loadlibs.C");
- }else if (gAlice){
- delete gAlice->GetRunLoader();
- delete gAlice;
- gAlice=0;
- } // end if
+ // Get geometry
+ TGeoManager::Import("geometry.root");
- TStopwatch timer;
+ // Dynamically link some shared libs
+ if (gClassTable->GetID("AliRun") < 0) {
+ gROOT->ProcessLine(".x $(ALICE_ROOT)/macros/loadlibs.C");
+ }else if (gAlice){
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice=0;
+ } // end if
+
+ TStopwatch timer;
#ifdef DEBUG
- cout << "Creating reconstructed points from digits for the ITS..." << endl;
+ cout << "Creating reconstructed points from digits for the ITS..." << endl;
#endif
- AliITSreconstruction *itsr = new AliITSreconstruction(filename);
+ AliITSreconstruction *itsr = new AliITSreconstruction(filename);
- timer.Start();
- if(!(fileRP.IsNull()))itsr->SetOutputFile(fileRP);
- itsr->Init();
- itsr->Exec();
- timer.Stop();
- timer.Print();
- delete itsr;
- return 0;
+ timer.Start();
+ if(!(fileRP.IsNull()))itsr->SetOutputFile(fileRP);
+ itsr->Init();
+ itsr->Exec();
+ timer.Stop();
+ timer.Print();
+ delete itsr;
+ return 0;
}
{
// Default Constructor
fSmear = 0;
+ AliRunLoader *rl =AliRunLoader::GetRunLoader();
+ TTree *trK=(TTree*)rl->TreeK();
+ if(!trK)AliFatal("This class should be used only with simulated events!!");
+ rl->LoadHeader();
}
//______________________________________________________________________
fSmear = new Double_t[3];
for(Int_t i=0;i<3;i++)fSmear[i]=smear[i];
Info("AliITSVertexerFast","Gaussian smaring of the generated vertex. Parameters %f12.5 , %f12.5 , %f12.5 \n",fSmear[0],fSmear[1],fSmear[2]);
+ AliRunLoader *rl =AliRunLoader::GetRunLoader();
+ TTree *trK=(TTree*)rl->TreeK();
+ if(!trK)AliFatal("This class should be used only with simulated events!!");
+ rl->LoadHeader();
+
}
+
//______________________________________________________________________
AliITSVertexerFast::~AliITSVertexerFast(){
// Destructor
AliRunLoader *rl =AliRunLoader::GetRunLoader();
rl->GetEvent(evnumb);
TArrayF primaryVertex(3); // true vertex
- AliHeader* header = gAlice->GetHeader();
+ AliHeader* header = rl->GetAliRun()->GetHeader();
AliGenEventHeader* genEventHeader = header->GenEventHeader();
genEventHeader->PrimaryVertex(primaryVertex);
-
+
// Smearing
Double_t vrttrue[3],vrtx[3];
for(Int_t k=0; k<3;k++){
fCurrentVertex = new AliESDVertex(vrtx,fSmear,name);
fCurrentVertex->SetTruePos(vrttrue);
return fCurrentVertex;
+
}
//______________________________________________________________________
SetPPsetting();
ConfigIterations();
SetWindowWidth();
+ SetVtxStart((Double_t)x0,(Double_t)y0,0.);
}
//
// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
//-------------------------------------------------------------------------
-//uncomment the line below for running with V1 cluster finder classes
-//#define V1
+
#include "AliRun.h"
//------------------------------------------------------------
// Tries to find mother's labels
//------------------------------------------------------------
+ AliRunLoader *rl = AliRunLoader::GetRunLoader();
+ TTree *trK=(TTree*)rl->TreeK();
+
+ if(trK){
Int_t label=lab[0];
if (label>=0) {
- TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
- label=-3;
- while (part->P() < 0.005) {
- Int_t m=part->GetFirstMother();
- if (m<0) {
- Info("CheckLabels","Primary momentum: %f",part->P());
- break;
- }
- if (part->GetStatusCode()>0) {
- Info("CheckLabels","Primary momentum: %f",part->P());
- break;
- }
- label=m;
- part=(TParticle*)gAlice->GetMCApp()->Particle(label);
- }
- if (lab[1]<0) lab[1]=label;
- else if (lab[2]<0) lab[2]=label;
- else ;//cerr<<"CheckLabels : No empty labels !\n";
+ TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
+ label=-3;
+ while (part->P() < 0.005) {
+ Int_t m=part->GetFirstMother();
+ if (m<0) {
+ Info("CheckLabels","Primary momentum: %f",part->P());
+ break;
+ }
+ if (part->GetStatusCode()>0) {
+ Info("CheckLabels","Primary momentum: %f",part->P());
+ break;
+ }
+ label=m;
+ part=(TParticle*)gAlice->GetMCApp()->Particle(label);
+ }
+ if (lab[1]<0) lab[1]=label;
+ else if (lab[2]<0) lab[2]=label;
+ else ;//cerr<<"CheckLabels : No empty labels !\n";
}
+ }
}
/*
//------------------------------------------------------------
// Tries to find mother's labels
//------------------------------------------------------------
- Int_t nlabels =0;
- for (Int_t i=0;i<10;i++) if (lab[i]>=0) nlabels++;
- if(nlabels == 0) return; // In case of no labels just exit
+ AliRunLoader *rl = AliRunLoader::GetRunLoader();
+ TTree *trK=(TTree*)rl->TreeK();
- Int_t ntracks = gAlice->GetMCApp()->GetNtrack();
+ if(trK){
+ Int_t nlabels =0;
+ for (Int_t i=0;i<10;i++) if (lab[i]>=0) nlabels++;
+ if(nlabels == 0) return; // In case of no labels just exit
- for (Int_t i=0;i<10;i++){
- Int_t label = lab[i];
- if (label>=0 && label<ntracks) {
- TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
- if (part->P() < 0.02) {
+ Int_t ntracks = gAlice->GetMCApp()->GetNtrack();
+
+ for (Int_t i=0;i<10;i++){
+ Int_t label = lab[i];
+ if (label>=0 && label<ntracks) {
+ TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
+ if (part->P() < 0.02) {
Int_t m=part->GetFirstMother();
if (m<0) {
continue;
continue;
}
lab[i]=m;
+ }
+ else
+ if (part->P() < 0.12 && nlabels>3) {
+ lab[i]=-2;
+ nlabels--;
+ }
}
- else
- if (part->P() < 0.12 && nlabels>3) {
+ else{
+ if ( (label>ntracks||label <0) && nlabels>3) {
lab[i]=-2;
nlabels--;
}
- }
- else{
- if ( (label>ntracks||label <0) && nlabels>3) {
- lab[i]=-2;
- nlabels--;
- }
- }
- }
- if (nlabels>3){
- for (Int_t i=0;i<10;i++){
- if (nlabels>3){
- Int_t label = lab[i];
- if (label>=0 && label<ntracks) {
- TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
- if (part->P() < 0.1) {
- lab[i]=-2;
- nlabels--;
+ }
+ }
+ if (nlabels>3){
+ for (Int_t i=0;i<10;i++){
+ if (nlabels>3){
+ Int_t label = lab[i];
+ if (label>=0 && label<ntracks) {
+ TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
+ if (part->P() < 0.1) {
+ lab[i]=-2;
+ nlabels--;
+ }
}
}
}
}
- }
- //compress labels -- if multi-times the same
- Int_t lab2[10];
- for (Int_t i=0;i<10;i++) lab2[i]=-2;
- for (Int_t i=0;i<10 ;i++){
- if (lab[i]<0) continue;
- for (Int_t j=0;j<10 &&lab2[j]!=lab[i];j++){
- if (lab2[j]<0) {
- lab2[j]= lab[i];
- break;
+ //compress labels -- if multi-times the same
+ Int_t lab2[10];
+ for (Int_t i=0;i<10;i++) lab2[i]=-2;
+ for (Int_t i=0;i<10 ;i++){
+ if (lab[i]<0) continue;
+ for (Int_t j=0;j<10 &&lab2[j]!=lab[i];j++){
+ if (lab2[j]<0) {
+ lab2[j]= lab[i];
+ break;
+ }
}
}
+ for (Int_t j=0;j<10;j++) lab[j]=lab2[j];
}
- for (Int_t j=0;j<10;j++) lab[j]=lab2[j];
-
}
static void AddLabel(Int_t lab[10], Int_t label) {
+// add label of the particle in the kine tree which originates this cluster
+// (used for reconstruction of MC data only, for comparison purposes)
+ AliRunLoader *rl = AliRunLoader::GetRunLoader();
+ TTree *trK=(TTree*)rl->TreeK();
- if(label<0) return; // In case of no label just exit
+ if(trK){
+ if(label<0) return; // In case of no label just exit
- Int_t ntracks = gAlice->GetMCApp()->GetNtrack();
- if (label>ntracks) return;
- for (Int_t i=0;i<10;i++){
- // if (label<0) break;
- if (lab[i]==label) break;
- if (lab[i]<0) {
- lab[i]= label;
- break;
+ Int_t ntracks = gAlice->GetMCApp()->GetNtrack();
+ if (label>ntracks) return;
+ for (Int_t i=0;i<10;i++){
+ // if (label<0) break;
+ if (lab[i]==label) break;
+ if (lab[i]<0) {
+ lab[i]= label;
+ break;
+ }
}
}
}
//***********************************
-#ifndef V1
void AliITSclustererV2::
FindCluster(Int_t k,Int_t maxz,AliBin *bins,Int_t &n,Int_t *idx) {
Info("FindClustersSSD", "found clusters in ITS SSD: %d", nClustersSSD);
}
-#else //V1
-
-#include "AliITSDetType.h"
-#include "AliITS.h"
-#include "AliITSsegmentationSPD.h"
-#include "AliITSClusterFinderSPD.h"
-
-#include "AliITSresponseSDD.h"
-#include "AliITSsegmentationSDD.h"
-#include "AliITSClusterFinderSDD.h"
-
-#include "AliITSsegmentationSSD.h"
-#include "AliITSClusterFinderSSD.h"
-
-
-void AliITSclustererV2::
-FindClustersSPD(const TClonesArray *digits, TClonesArray *clusters) {
- //------------------------------------------------------------
- // Actual SPD cluster finding based on AliITSClusterFinderSPD
- //------------------------------------------------------------
- static AliITS *its=(AliITS*)gAlice->GetModule("ITS");
- static TClonesArray *points=its->RecPoints();
- static AliITSsegmentationSPD *seg=
- (AliITSsegmentationSPD *)its->DetType(0)->GetSegmentationModel();
- static AliITSClusterFinderSPD cf(seg, (TClonesArray*)digits, points);
-
- cf.FindRawClusters(fI);
- RecPoints2Clusters(points, fI, clusters);
- its->ResetRecPoints();
-
-}
-
-void AliITSclustererV2::
-FindClustersSDD(const TClonesArray *digits, TClonesArray *clusters) {
- //------------------------------------------------------------
- // Actual SDD cluster finding based on AliITSClusterFinderSDD
- //------------------------------------------------------------
- static AliITS *its=(AliITS*)gAlice->GetModule("ITS");
- static TClonesArray *points=its->RecPoints();
- static AliITSresponseSDD *resp=
- (AliITSresponseSDD *)its->DetType(1)->GetResponseModel();
- static AliITSsegmentationSDD *seg=
- (AliITSsegmentationSDD *)its->DetType(1)->GetSegmentationModel();
- static AliITSClusterFinderSDD
- cf(seg,resp,(TClonesArray*)digits,its->ClustersAddress(1));
-
- cf.FindRawClusters(fI);
- Int_t nc=points->GetEntriesFast();
- while (nc--) { //To be consistent with the SSD cluster charges
- AliITSRecPoint *p=(AliITSRecPoint*)points->UncheckedAt(nc);
- p->SetQ(p->GetQ()/12.);
- }
- RecPoints2Clusters(points, fI, clusters);
- its->ResetClusters(1);
- its->ResetRecPoints();
-
-}
-
-void AliITSclustererV2::
-FindClustersSSD(const TClonesArray *digits, TClonesArray *clusters) {
- //------------------------------------------------------------
- // Actual SSD cluster finding based on AliITSClusterFinderSSD
- //------------------------------------------------------------
- static AliITS *its=(AliITS*)gAlice->GetModule("ITS");
- static TClonesArray *points=its->RecPoints();
- static AliITSsegmentationSSD *seg=
- (AliITSsegmentationSSD *)its->DetType(2)->GetSegmentationModel();
- static AliITSClusterFinderSSD cf(seg,(TClonesArray*)digits);
-
- cf.FindRawClusters(fI);
- RecPoints2Clusters(points, fI, clusters);
- its->ResetRecPoints();
-
-}
-
-#endif
#include "AliESD.h"
#include "AliESDtrack.h"
#include "AliITStrackV2.h"
-#include "AliITSclusterV2.h"
+#include "AliITSRecPoint.h"
#include "AliITStrackerMI.h"
#include "AliITSLoader.h"
#include "AliITSPident.h"
Int_t cluindssd1 = track->GetClusterIndex(1);
Int_t cluindssd2 = track->GetClusterIndex(0);
Float_t q1,q1corr,q2,q2corr,q3,q3corr,q4,q4corr;
- AliITSclusterV2* clu1=(AliITSclusterV2*)fTracker->GetCluster(cluindsdd1);
+ AliITSRecPoint* clu1=(AliITSRecPoint*)fTracker->GetCluster(cluindsdd1);
if(clu1!=0){
q1=clu1->GetQ();
q1corr=q1*TMath::Sqrt((1-snp*snp)/(1+tgl*tgl));
q1corr=-99;
}
- AliITSclusterV2* clu2=(AliITSclusterV2*)fTracker->GetCluster(cluindsdd2);
+ AliITSRecPoint* clu2=(AliITSRecPoint*)fTracker->GetCluster(cluindsdd2);
if(clu2!=0){
q2=clu2->GetQ();
q2corr=q2*TMath::Sqrt((1-snp*snp)/(1+tgl*tgl));
q2corr=-99;
}
- AliITSclusterV2* clu3=(AliITSclusterV2*)fTracker->GetCluster(cluindssd1);
+ AliITSRecPoint* clu3=(AliITSRecPoint*)fTracker->GetCluster(cluindssd1);
if(clu3!=0){
q3=clu3->GetQ();
q3corr=q3*TMath::Sqrt((1-snp*snp)/(1+tgl*tgl));
q3corr=-99;
}
- AliITSclusterV2* clu4=(AliITSclusterV2*)fTracker->GetCluster(cluindssd2);
+ AliITSRecPoint* clu4=(AliITSRecPoint*)fTracker->GetCluster(cluindssd2);
if(clu4!=0){
q4=clu4->GetQ();
q4corr=q4*TMath::Sqrt((1-snp*snp)/(1+tgl*tgl));
Float_t prie=0.;
Double_t invPt=track->Get1Pt();
AliITSPident mypid(momits,invPt,dEdxsignal,fSp,qlay,prip,prik,pripi,prie);
- condprobfun[0]=0.;//el
- condprobfun[1]=0.;//mu
- condprobfun[2]=mypid.GetProdCondFunPi();//pi
+ condprobfun[0]=mypid.GetProdCondFunPi();//el -> ITS does not distinguish among Pi,mu,el
+ condprobfun[1]=mypid.GetProdCondFunPi();//mu -> ITS does not distinguish among Pi,mu,el
+ condprobfun[2]=mypid.GetProdCondFunPi();//pi -> ITS does not distinguish among Pi,mu,el
condprobfun[3]=mypid.GetProdCondFunK();//kaon
condprobfun[4]=mypid.GetProdCondFunPro();//pro
Error("AliITSreconstruction","Can not load the session",filename);
return;
}
- fRunLoader->LoadgAlice();
- gAlice = fRunLoader->GetAliRun();
-
- if(!gAlice) {
- Error("AliITSreconstruction","gAlice not found on file. Aborting.");
- fInit = kFALSE;
- return;
- } // end if !gAlice
}
Error("Init","Run Loader is NULL");
return kFALSE;
}
- fRunLoader->LoadgAlice();
- fRunLoader->LoadHeader();
+ // fRunLoader->LoadgAlice();
+ // fRunLoader->LoadHeader();
fLoader = (AliITSLoader*) fRunLoader->GetLoader("ITSLoader");
if(!fLoader) {
// Now ready to init.
- fRunLoader->CdGAFile();
+ //fRunLoader->CdGAFile();
fITSgeom = fLoader->GetITSgeom();
fDetTypeRec = new AliITSDetTypeRec(fLoader);
fEnt0 = 0;
//fEnt = gAlice->GetEventsPerRun();
- fEnt = Int_t(fRunLoader->TreeE()->GetEntries());
+ fEnt = Int_t(fRunLoader->GetNumberOfEvents());
fLoader->LoadDigits("read");
fLoader->LoadRecPoints("recreate");