fStatusOK(kTRUE){
// Default constructor
+ for(Int_t i=0;i<6;i++)fNClusters[i]=0;
if(fgkNModules != AliITSgeomTGeo::GetNModules())AliError(Form("The total number of modules is not %d, but %d",fgkNModules,AliITSgeomTGeo::GetNModules()));
Int_t modperlay[6];
fActualSize = branch->GetEntries();
CookEntries();
if(fDet.IsNull())return NULL;
-
// it is assumed that the filling order of the tree is SPD, SDD, SSD
// even if one or two subdetector are missing
+ Int_t modL1=AliITSgeomTGeo::GetNDetectors(1)*AliITSgeomTGeo::GetNLadders(1);
if(IsSPDActive()){
for(Int_t i=0;i<fSPDNModules;i++){
branch->SetAddress(&fArray[i]);
branch->GetEvent(i);
+ if(i<modL1){
+ fNClusters[0]+=fArray[i]->GetEntries();
+ }
+ else {
+ fNClusters[1]+=fArray[i]->GetEntries();
+ }
}
}
if(IsSDDActive()){
Int_t start=0;
if(IsSPDActive())start+=fSPDNModules;
+ Int_t modL3=AliITSgeomTGeo::GetNDetectors(3)*AliITSgeomTGeo::GetNLadders(3);
Int_t counter = fSPDNModules;
for(Int_t i=start;i<start+fSDDNModules;i++){
branch->SetAddress(&fArray[counter]);
++counter;
branch->GetEvent(i);
+ if((i-start)<modL3){
+ fNClusters[2]+=fArray[i]->GetEntries();
+ }
+ else {
+ fNClusters[3]+=fArray[i]->GetEntries();
+ }
}
}
if(IsSSDActive()){
Int_t start=0;
if(IsSPDActive())start+=fSPDNModules;
if(IsSDDActive())start+=fSDDNModules;
+ Int_t modL5=AliITSgeomTGeo::GetNDetectors(5)*AliITSgeomTGeo::GetNLadders(5);
Int_t counter = fSPDNModules+fSDDNModules;
for(Int_t i=start;i<start+fSSDNModules;i++){
branch->SetAddress(&fArray[counter]);
++counter;
branch->GetEvent(i);
+ if((i-start)<modL5){
+ fNClusters[4]+=fArray[i]->GetEntries();
+ }
+ else {
+ fNClusters[5]+=fArray[i]->GetEntries();
+ }
}
}
}
}
}
-
+//______________________________________________________________________
+UInt_t AliITSRecPointContainer::GetNClustersInLayer(Int_t lay, TTree* tR, Int_t eventN){
+ // returns the number of clusters for laier lay
+ // layers are numbered from 1 to 6
+ if(lay<1 || lay >6){
+ AliError(Form("Layer %d is out of range",lay));
+ return 0;
+ }
+ if(eventN>=0){
+ FetchClusters(0,tR,eventN);
+ }
+ else {
+ FetchClusters(0,tR);
+ }
+ return fNClusters[lay-1];
+}
+//______________________________________________________________________
+UInt_t AliITSRecPointContainer::GetNClustersInLayerFast(Int_t lay) const {
+ // returns the number of clusters for laier lay
+ // layers are numbered from 1 to 6
+ // No checks are done on the event number: the numer of clusters
+ // for the event stored in memory is returned
+ if(lay<1 || lay >6){
+ AliError(Form("Layer %d is out of range",lay));
+ return 0;
+ }
+ return fNClusters[lay-1];
+}
//______________________________________________________________________
AliITSRecPointContainer* AliITSRecPointContainer::Instance(const AliITSRecoParam* kptr){
// returns AliITSRecPointContainer instance (singleton)
(fArray[i])->Clear();
}
fDet="";
+ for(Int_t i=0;i<6;i++)fNClusters[i]=0;
}
TClonesArray* FetchClusters(Int_t mod, TTree* tR,Int_t cureve);
TClonesArray* UncheckedGetClusters(Int_t mod) const {return fArray[mod];}
+ // In the following two methods: 1<=lay<=6 (i.e. layers numbered from 1)
+ UInt_t GetNClustersInLayer(Int_t lay, TTree* tR, Int_t eventN=-1);
+ UInt_t GetNClustersInLayerFast(Int_t lay) const;
+
private:
// methods
AliITSRecPointContainer(const AliITSRecoParam* krp=NULL); // Default constructor
TString fDet; //! ITS subdetectors active for the current run
Bool_t fStatusOK; //! kFALSE is RP branch is absent or if there are anomalies
//! in the number of active modules
+ UInt_t fNClusters[6]; //! Number of clusters per layer
ClassDef(AliITSRecPointContainer,0)
};
Int_t nrpL1 = 0; // number of rec points on layer 1
Int_t nrpL2 = 0; // number of rec points on layer 2
-
- // By default irstL1=0 and lastL1=79
- Int_t firstL1 = AliITSgeomTGeo::GetModuleIndex(1,1,1);
- Int_t lastL1 = AliITSgeomTGeo::GetModuleIndex(2,1,1)-1;
- for(Int_t module= firstL1; module<=lastL1;module++){ // count number of recopints on layer 1
- itsRec=rpcont->UncheckedGetClusters(module);
- nrpL1+= itsRec->GetEntries();
- }
- //By default firstL2=80 and lastL2=239
- Int_t firstL2 = AliITSgeomTGeo::GetModuleIndex(2,1,1);
- Int_t lastL2 = AliITSgeomTGeo::GetModuleIndex(3,1,1)-1;
- for(Int_t module= firstL2; module<=lastL2;module++){ // count number of recopints on layer 2
- itsRec=rpcont->UncheckedGetClusters(module);
- nrpL2+= itsRec->GetEntries();
- }
+ nrpL1=rpcont->GetNClustersInLayerFast(1);
+ nrpL2=rpcont->GetNClustersInLayerFast(2);
if(nrpL1 == 0 || nrpL2 == 0){
AliDebug(1,Form("No RecPoints in at least one SPD layer (%d %d)",nrpL1,nrpL2));
return -1;
Int_t nolines = 0;
// Loop on modules of layer 1
+ Int_t firstL1 = AliITSgeomTGeo::GetModuleIndex(1,1,1);
+ Int_t lastL1 = AliITSgeomTGeo::GetModuleIndex(2,1,1)-1;
for(Int_t modul1= firstL1; modul1<=lastL1;modul1++){ // Loop on modules of layer 1
if(!fUseModule[modul1]) continue;
UShort_t ladder=int(modul1/4)+1; // ladders are numbered starting from 1
Int_t nrpL1 = 0;
Int_t nrpL2 = 0;
+ nrpL1=rpcont->GetNClustersInLayerFast(1);
+ nrpL2=rpcont->GetNClustersInLayerFast(2);
- // By default fFirstL1=0 and fLastL1=79
- for(Int_t module= fFirstL1; module<=fLastL1;module++){
- itsRec=rpcont->UncheckedGetClusters(module);
- nrpL1+= itsRec->GetEntries();
- }
- //By default fFirstL2=80 and fLastL2=239
- for(Int_t module= fFirstL2; module<=fLastL2;module++){
- itsRec=rpcont->UncheckedGetClusters(module);
- nrpL2+= itsRec->GetEntries();
- }
if(nrpL1 == 0 || nrpL2 == 0){
AliDebug(1,Form("No RecPoints in at least one SPD layer (%d %d)",nrpL1,nrpL2));
ResetHistograms();