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)
return fgInstance;
}
+//______________________________________________________________________
+void AliITSRecPointContainer::Destroy(){
+ // deletes the singleton
+ if(fgInstance){
+ delete fgInstance;
+ fgInstance = NULL;
+ }
+}
+
//______________________________________________________________________
void AliITSRecPointContainer::Reset(){
// Resets the status of the object
- for(Int_t i=0;i<fgkNModules;i++){
- (fArray[i])->Clear();
- }
+ ClearClus(0,fgkNModules);
fDet="";
+ for(Int_t i=0;i<6;i++)fNClusters[i]=0;
}
+//______________________________________________________________________
+void AliITSRecPointContainer::ResetSPD(){
+ // Resets only the entries in fArray concerning SPD
+ // This method should be used with care only when the filling
+ // of the container is not done from the RP TTree.
+ fCurrentEve = -1000; // protection: if FetchClusters method will be used
+ // after this call, an ccess to the RP TTree will
+ // be forced
+ ClearClus(0,fSPDNModules);
+}
+
+//______________________________________________________________________
+void AliITSRecPointContainer::ResetSDD(){
+ // Resets only the entries in fArray concerning SDD
+ // This method should be used with care only when the filling
+ // of the container is not done from the RP TTree.
+ fCurrentEve = -1000; // protection: if FetchClusters method will be used
+ // after this call, an ccess to the RP TTree will
+ // be forced
+ Int_t first = fSPDNModules;
+ Int_t last = first + fSDDNModules;
+ ClearClus(first,last);
+}
+
+//______________________________________________________________________
+void AliITSRecPointContainer::ResetSSD(){
+ // Resets only the entries in fArray concerning SSD
+ // This method should be used with care only when the filling
+ // of the container is not done from the RP TTree.
+ fCurrentEve = -1000; // protection: if FetchClusters method will be used
+ // after this call, an ccess to the RP TTree will
+ // be forced
+ Int_t first = fSPDNModules + fSDDNModules;
+ Int_t last = first + fSSDNModules;
+ ClearClus(first,last);
+}
+