]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Modifications to reduce the size in memory (E.Crescio)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 25 Jul 2005 16:53:42 +0000 (16:53 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 25 Jul 2005 16:53:42 +0000 (16:53 +0000)
ITS/AliITS.h
ITS/AliITSDetTypeRec.cxx
ITS/AliITSDetTypeRec.h
ITS/AliITSDetTypeSim.cxx
ITS/AliITSDetTypeSim.h
ITS/AliITSvBeamTestITS04.cxx
ITS/AliITSvPPRasymmFMD.cxx
ITS/AliITSvSDD03.cxx
ITS/AliITSvSPD02.cxx
ITS/AliITSvSSD03.cxx

index 49cda5cb0e494230cdf01bb23f56c523a25de59a..1fc8596f2d711d34102ef1c9b4d427cb81102a89 100644 (file)
@@ -82,8 +82,8 @@ class AliITS : public AliDetector {
     Option_t* GetDetectors(){return fOpt;}
 
     // Set response
-    virtual void SetResponseModel(Int_t module, AliITSresponse *response){
-        fDetTypeSim->SetResponseModel(module,response);}
+    virtual void SetResponseModel(Int_t dettype, AliITSresponse *response){
+        fDetTypeSim->SetResponseModel(dettype,response);}
     // Set segmentation for Simulation
     virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg){
         fDetTypeSim->SetSegmentationModel(id,seg);}
index e6915d63fbe2b6fdfd4e33fe801271692e4abd92..d02719936968cef9ab45435da89aea108e292519 100644 (file)
@@ -188,17 +188,17 @@ AliITSsegmentation* AliITSDetTypeRec::GetSegmentationModel(Int_t dettype){
 
 }
 //_______________________________________________________________________
-void AliITSDetTypeRec::SetCalibrationModel(Int_t module,AliITSresponse *resp){
+void AliITSDetTypeRec::SetCalibrationModel(Int_t dettype,AliITSresponse *resp){
 
   
   //Set segmentation model for module number
-  if(fCalibration==0) fCalibration = new TObjArray(fGeom->GetIndexMax());
-  if(fCalibration->At(module)!=0) delete fCalibration->At(module);
-  fCalibration->AddAt(resp,module);
+  if(fCalibration==0) fCalibration = new TObjArray(fgkNdettypes);
+  if(fCalibration->At(dettype)!=0) delete fCalibration->At(dettype);
+  fCalibration->AddAt(resp,dettype);
  
 }
 //_______________________________________________________________________
-AliITSresponse* AliITSDetTypeRec::GetCalibrationModel(Int_t module){
+AliITSresponse* AliITSDetTypeRec::GetCalibrationModel(Int_t dettype){
   
   //Get segmentation model for module number
   
@@ -206,7 +206,7 @@ AliITSresponse* AliITSDetTypeRec::GetCalibrationModel(Int_t module){
     Warning("GetalibrationModel","fResponse is 0!");
     return 0; 
   }  
-  return (AliITSresponse*)fCalibration->At(module);
+  return (AliITSresponse*)fCalibration->At(dettype);
 }
 
 //______________________________________________________________________
@@ -295,11 +295,21 @@ void AliITSDetTypeRec::SetDefaults(){
     if(dettype==0){
       seg = new AliITSsegmentationSPD(fGeom);
       SetSegmentationModel(dettype,seg);
+      SetCalibrationModel(dettype,new AliITSresponseSPD());
+      SetDigitClassName(dettype,"AliITSdigitSPD");
+      SetClusterClassName(dettype,"AliITSRawClusterSPD");
+
     }
     if(dettype==1){
       res = new AliITSresponseSDD("simulated");
       seg = new AliITSsegmentationSDD(fGeom,res);
       SetSegmentationModel(dettype,seg);
+      SetCalibrationModel(dettype,new AliITSresponseSDD("simulated"));
+      const char *kopt = GetCalibrationModel(dettype)->ZeroSuppOption();
+      if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) SetDigitClassName(dettype,"AliITSdigit");
+      else SetDigitClassName(dettype,"AliITSdigitSDD");
+      SetClusterClassName(dettype,"AliITSRawClusterSDD");
+
     }
     if(dettype==2){
       AliITSsegmentationSSD* seg2 = new AliITSsegmentationSSD(fGeom);
@@ -308,31 +318,11 @@ void AliITSDetTypeRec::SetDefaults(){
       seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
 
       SetSegmentationModel(dettype,seg2);
-    }
-
-  }
-
-  for(Int_t imod=0;imod<fGeom->GetIndexMax();imod++){
-    Int_t dettype = fGeom->GetModuleType(imod);
-    //SPD
-    if(dettype==0){
-      SetCalibrationModel(imod,new AliITSresponseSPD());
-      SetDigitClassName(dettype,"AliITSdigitSPD");
-      SetClusterClassName(dettype,"AliITSRawClusterSPD");
-    }
-    //SDD
-    if(dettype==1){
-      SetCalibrationModel(imod,new AliITSresponseSDD("simulated"));
-      const char *kopt = GetCalibrationModel(imod)->ZeroSuppOption();
-      if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) SetDigitClassName(dettype,"AliITSdigit");
-      else SetDigitClassName(dettype,"AliITSdigitSDD");
-      SetClusterClassName(dettype,"AliITSRawClusterSDD");
-    }
-    //SSD
-    if(dettype==2){
-      SetCalibrationModel(imod,new AliITSresponseSSD("simulated"));
+      SetCalibrationModel(dettype,new AliITSresponseSSD("simulated"));
       SetDigitClassName(dettype,"AliITSdigitSSD");
       SetClusterClassName(dettype,"AliITSRawClusterSSD");
+
+     
     }
 
   }
@@ -356,8 +346,7 @@ void AliITSDetTypeRec::SetDefaultClusterFinders(){
 
   MakeTreeC();
  
- for(Int_t imod=0;imod<fGeom->GetIndexMax();imod++){
-    Int_t dettype = fGeom->GetModuleType(imod);
+ for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
     //SPD
     if(dettype==0){
       if(!GetReconstructionModel(dettype)){
@@ -372,7 +361,7 @@ void AliITSDetTypeRec::SetDefaultClusterFinders(){
     if(dettype==1){
       if(!GetReconstructionModel(dettype)){
        seg = (AliITSsegmentation*)GetSegmentationModel(dettype);
-        res = (AliITSresponse*)GetCalibrationModel(imod);
+        res = (AliITSresponse*)GetCalibrationModel(dettype);
        TClonesArray *dig1 = DigitsAddress(1);
        TClonesArray *rec1 = ClustersAddress(1);
        clf = new AliITSClusterFinderSDD(seg,res,dig1,rec1);
@@ -397,7 +386,7 @@ void AliITSDetTypeRec::SetDefaultClusterFinders(){
 }
 
 //________________________________________________________________
-void AliITSDetTypeRec::SetDefaultClusterFindersV2(){
+void AliITSDetTypeRec::SetDefaultClusterFindersV2(Bool_t rawdata){
 
   //Set defaults for cluster finder V2
 
@@ -410,8 +399,7 @@ void AliITSDetTypeRec::SetDefaultClusterFindersV2(){
   AliITSClusterFinder *clf; 
 
   MakeTreeC();
-  for(Int_t imod=0;imod<fGeom->GetIndexMax();imod++){
-    Int_t dettype = fGeom->GetModuleType(imod);
+  for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
     //SPD
     if(dettype==0){
       if(!GetReconstructionModel(dettype)){
@@ -419,7 +407,7 @@ void AliITSDetTypeRec::SetDefaultClusterFindersV2(){
        clf = new AliITSClusterFinderV2SPD(fGeom);
        clf->InitGeometry();
        clf->SetSegmentation(seg);
-       clf->SetDigits(DigitsAddress(0));
+       if(!rawdata) clf->SetDigits(DigitsAddress(0));
        SetReconstructionModel(dettype,clf);
 
       }
@@ -431,7 +419,7 @@ void AliITSDetTypeRec::SetDefaultClusterFindersV2(){
        clf = new AliITSClusterFinderV2SDD(fGeom);
        clf->InitGeometry();    
        clf->SetSegmentation(seg);
-       clf->SetDigits(DigitsAddress(1));
+       if(!rawdata) clf->SetDigits(DigitsAddress(1));
        SetReconstructionModel(dettype,clf);
       }
 
@@ -444,7 +432,7 @@ void AliITSDetTypeRec::SetDefaultClusterFindersV2(){
        clf = new AliITSClusterFinderV2SSD(fGeom);
        clf->InitGeometry();
        clf->SetSegmentation(seg);
-       clf->SetDigits(DigitsAddress(2));
+       if(!rawdata) clf->SetDigits(DigitsAddress(2));
        SetReconstructionModel(dettype,clf);
       }
     }
@@ -725,7 +713,7 @@ void AliITSDetTypeRec::AddClusterV2(const AliITSclusterV2 &r){
 
     TClonesArray &lrecp = *fClustersV2;
     new(lrecp[fNClustersV2++]) AliITSclusterV2(r);
-}
+ }
 
 //______________________________________________________________________
 void AliITSDetTypeRec::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt, Bool_t v2){
@@ -818,7 +806,7 @@ void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader){
   //      none.
   // Return:
   //      none.
-  if(fGeom){
+  if(!fGeom){
     Warning("DigitsToRecPoints","fGeom is null!");
     return;
   }
@@ -827,7 +815,6 @@ void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader){
     return;
   }
 
-  SetDefaultClusterFindersV2();
   
   AliITSClusterFinderV2 *rec     = 0;
   Int_t id=0;
index 553497009403b403115dbc033c8ecb236b58876e..8a3ddf9e53c2c09dca6a808d6cc6b5f8af7f023e 100644 (file)
@@ -41,16 +41,16 @@ class AliITSDetTypeRec : public TObject {
     AliITSLoader* GetLoader() const {return fLoader;}
     virtual void SetDefaults();
     virtual void SetDefaultClusterFinders();
-    virtual void SetDefaultClusterFindersV2();
+    virtual void SetDefaultClusterFindersV2(Bool_t rawdata=kFALSE);
     virtual void MakeBranch(Option_t *opt);
     virtual void SetTreeAddress();
     virtual void SetTreeAddressD(TTree* treeD);
 
     virtual void SetSegmentationModel(Int_t dettype, AliITSsegmentation *seg);
-    virtual void SetCalibrationModel(Int_t module, AliITSresponse *cal);
+    virtual void SetCalibrationModel(Int_t dettype, AliITSresponse *cal);
     virtual void SetReconstructionModel(Int_t dettype, AliITSClusterFinder *rec);
     virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype);
-    virtual AliITSresponse* GetCalibrationModel(Int_t module);
+    virtual AliITSresponse* GetCalibrationModel(Int_t dettype);
     virtual AliITSClusterFinder* GetReconstructionModel(Int_t dettype);
 
     virtual void SetDigitClassName(Int_t i,Char_t *digit) 
index d6c4993d624a54bc716428bda12a7a2cc07ccf7a..d809e8f1ad6c2c848809e940a488c8c8e618655f 100644 (file)
@@ -227,12 +227,12 @@ AliITSsegmentation* AliITSDetTypeSim::GetSegmentationModelByModule(Int_t module)
 
 }
 //_______________________________________________________________________
-void AliITSDetTypeSim::SetResponseModel(Int_t module,AliITSresponse *resp){
+void AliITSDetTypeSim::SetResponseModel(Int_t dettype,AliITSresponse *resp){
 
   
   //Set segmentation model for module number
-  if(fResponse==0) fResponse = new TObjArray(fGeom->GetIndexMax());
-  fResponse->AddAt(resp,module);
+  if(fResponse==0) fResponse = new TObjArray(fgkNdettypes);
+  fResponse->AddAt(resp,dettype);
 }
 //______________________________________________________________________
 void AliITSDetTypeSim::ResetResponse(){
@@ -256,7 +256,7 @@ void AliITSDetTypeSim::ResetSegmentation(){
 }
 
 //_______________________________________________________________________
-AliITSresponse* AliITSDetTypeSim::GetResponseModel(Int_t module){
+AliITSresponse* AliITSDetTypeSim::GetResponseModel(Int_t dettype){
   
   //Get segmentation model for module number
   
@@ -264,7 +264,7 @@ AliITSresponse* AliITSDetTypeSim::GetResponseModel(Int_t module){
     Warning("GetResponseModel","fResponse is 0!");
     return 0; 
   }  
-  return (AliITSresponse*)(fResponse->At(module));
+  return (AliITSresponse*)(fResponse->At(dettype));
 }
 //_______________________________________________________________________
 void AliITSDetTypeSim::SetDefaults(){
@@ -277,57 +277,56 @@ void AliITSDetTypeSim::SetDefaults(){
     return;
   }
 
-  if(!fResponse) fResponse = new TObjArray(fGeom->GetIndexMax());  
+  if(!fResponse) fResponse = new TObjArray(fgkNdettypes);  
 
   AliITSsegmentation* seg;
   AliITSresponse* res;
   ResetResponse();
   ResetSegmentation();
 
-  for(Int_t imod=0;imod<fGeom->GetIndexMax();imod++){
-      Int_t dettype = fGeom->GetModuleType(imod);
+  for(Int_t idet=0;idet<fgkNdettypes;idet++){
     //SPD
-    if(dettype==0){
-      if(!GetSegmentationModel(dettype)){
+    if(idet==0){
+      if(!GetSegmentationModel(idet)){
        seg = new AliITSsegmentationSPD(fGeom);
-       SetSegmentationModel(dettype,seg);
+       SetSegmentationModel(idet,seg);
       }
-      if(!GetResponseModel(imod)){
+      if(!GetResponseModel(idet)){
        res = new AliITSresponseSPD();
-       SetResponseModel(imod,res);
+       SetResponseModel(idet,res);
       }
-      const char *kData0=(GetResponseModel(imod))->DataType();
+      const char *kData0=(GetResponseModel(idet))->DataType();
       if (strstr(kData0,"real")) {
-       SetDigitClassName(dettype,"AliITSdigit");
-      } else SetDigitClassName(dettype,"AliITSdigitSPD");
+       SetDigitClassName(idet,"AliITSdigit");
+      } else SetDigitClassName(idet,"AliITSdigitSPD");
     }
     //SDD
-    if(dettype==1){
-      if(!GetResponseModel(imod)){
-       SetResponseModel(imod,new AliITSresponseSDD("simulated"));
+    if(idet==1){
+      if(!GetResponseModel(idet)){
+       SetResponseModel(idet,new AliITSresponseSDD("simulated"));
       }
-      if(!GetSegmentationModel(dettype)){
-       res = GetResponseModel(imod);
+      if(!GetSegmentationModel(idet)){
+       res = GetResponseModel(idet);
        seg = new AliITSsegmentationSDD(fGeom,res);
-       SetSegmentationModel(dettype,seg);
+       SetSegmentationModel(idet,seg);
       }
-      const char *kopt = GetResponseModel(imod)->ZeroSuppOption();
-      if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) SetDigitClassName(dettype,"AliITSdigit");
-      else SetDigitClassName(dettype,"AliITSdigitSDD");
+      const char *kopt = GetResponseModel(idet)->ZeroSuppOption();
+      if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) SetDigitClassName(idet,"AliITSdigit");
+      else SetDigitClassName(idet,"AliITSdigitSDD");
     }
     //SSD
-    if(dettype==2){
-      if(!GetSegmentationModel(dettype)){
+    if(idet==2){
+      if(!GetSegmentationModel(idet)){
        seg = new AliITSsegmentationSSD(fGeom);
-       SetSegmentationModel(dettype,seg);
+       SetSegmentationModel(idet,seg);
       }
-      if(!GetResponseModel(imod)){
-       SetResponseModel(imod,new AliITSresponseSSD("simulated"));
+      if(!GetResponseModel(idet)){
+       SetResponseModel(idet,new AliITSresponseSSD("simulated"));
       }
-      const char *kData2 = (GetResponseModel(imod))->DataType();
+      const char *kData2 = (GetResponseModel(idet))->DataType();
       if (strstr(kData2,"real")) {
-       SetDigitClassName(dettype,"AliITSdigit");
-      } else SetDigitClassName(dettype,"AliITSdigitSSD");
+       SetDigitClassName(idet,"AliITSdigit");
+      } else SetDigitClassName(idet,"AliITSdigitSSD");
       
     }
 
@@ -346,7 +345,7 @@ void AliITSDetTypeSim::SetDefaultSimulation(){
     return;
   }
   
-  if(!fResponse) fResponse = new TObjArray(fGeom->GetIndexMax());
+  if(!fResponse) fResponse = new TObjArray(fgkNdettypes);
 
   AliITSsegmentation* seg;
   AliITSresponse* res;
@@ -358,11 +357,11 @@ void AliITSDetTypeSim::SetDefaultSimulation(){
       sim = GetSimulationModel(idet);
       if(!sim){
        seg = (AliITSsegmentationSPD*)GetSegmentationModel(idet);
-       res = (AliITSresponseSPD*)GetResponseModel(fGeom->GetStartSPD());      
+       res = (AliITSresponseSPD*)GetResponseModel(idet);      
        sim = new AliITSsimulationSPD(seg,res);
        SetSimulationModel(idet,sim);
       } else{
-       sim->SetResponseModel(GetResponseModel(fGeom->GetStartSPD()));
+       sim->SetResponseModel(GetResponseModel(idet));
        sim->SetSegmentationModel((AliITSsegmentationSPD*)GetSegmentationModel(idet));
        sim->Init();
       }
@@ -372,11 +371,11 @@ void AliITSDetTypeSim::SetDefaultSimulation(){
       sim = GetSimulationModel(idet);
       if(!sim){
        seg = (AliITSsegmentationSDD*)GetSegmentationModel(idet);
-       res = (AliITSresponseSDD*)GetResponseModel(fGeom->GetStartSDD());
+       res = (AliITSresponseSDD*)GetResponseModel(idet);
        sim = new AliITSsimulationSDD(seg,res);
        SetSimulationModel(idet,sim);
       } else {
-       sim->SetResponseModel((AliITSresponseSDD*)GetResponseModel(fGeom->GetStartSDD()));
+       sim->SetResponseModel((AliITSresponseSDD*)GetResponseModel(idet));
        sim->SetSegmentationModel((AliITSsegmentationSDD*)GetSegmentationModel(idet));
        sim->Init();
       }
@@ -387,11 +386,11 @@ void AliITSDetTypeSim::SetDefaultSimulation(){
       sim = GetSimulationModel(idet);
       if(!sim){
        seg = (AliITSsegmentationSSD*)GetSegmentationModel(idet);
-       res = (AliITSresponseSSD*)GetResponseModel(fGeom->GetStartSSD());
+       res = (AliITSresponseSSD*)GetResponseModel(idet);
        sim = new AliITSsimulationSSD(seg,res);
        SetSimulationModel(idet,sim);
       } else{
-       sim->SetResponseModel((AliITSresponseSSD*)GetResponseModel(fGeom->GetStartSSD()));
+       sim->SetResponseModel((AliITSresponseSSD*)GetResponseModel(idet));
        sim->SetSegmentationModel((AliITSsegmentationSSD*)GetSegmentationModel(idet));
        sim->Init();
       }
@@ -582,7 +581,7 @@ void AliITSDetTypeSim::AddSimDigit(Int_t branch,Float_t phys,Int_t *digits,
     new(ldigits[fNDigits[branch]++]) AliITSdigitSPD(digits,tracks,hits);
     break;
   case 1:
-    resp = (AliITSresponseSDD*)GetResponseModel(fGeom->GetStartSDD());
+    resp = (AliITSresponseSDD*)GetResponseModel(branch);
     new(ldigits[fNDigits[branch]++]) AliITSdigitSDD(phys,digits,tracks,
                                                   hits,charges,resp);
     break;
index 8125d624f10060c9995e4fd1c588a70ede1364be..cd182174165cf0a87dde369e5e24f8d4a7897d5a 100644 (file)
@@ -43,8 +43,8 @@ class AliITSDetTypeSim : public TObject {
     virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype);
     virtual AliITSsegmentation* GetSegmentationModelByModule(Int_t module);
 
-    virtual void SetResponseModel(Int_t module,AliITSresponse *resp);
-    virtual AliITSresponse* GetResponseModel(Int_t module);
+    virtual void SetResponseModel(Int_t dettype,AliITSresponse *resp);
+    virtual AliITSresponse* GetResponseModel(Int_t dettype);
 
     TObjArray* GetResponse() const {return fResponse;}
     TObjArray* GetSegmentation() const {return fSegmentation;}
index 4ac11f9a80f411c3c5c9760d3736463c22940ade..8fff13362135ad812e0c2dc85c786995d44b17cb 100644 (file)
@@ -404,15 +404,8 @@ void AliITSvBeamTestITS04::SetDefaults()
 
     s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);// Get shape info.
     if (s0) {
-       AliITSresponse *resp0=0;
-       Int_t nspd=0;
-       for(Int_t nmod=0;nmod<GetITSgeom()->GetIndexMax();nmod++){
-         if(GetITSgeom()->GetModuleType(nmod)==kSPD){
-           resp0 = new AliITSresponseSPD();
-           SetResponseModel(nmod,resp0);
-           nspd=nmod;
-         }
-       }
+       AliITSresponse *resp0=new AliITSresponseSPD();
+       SetResponseModel(kSPD,resp0);
 
        AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(GetITSgeom());
        seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
@@ -430,7 +423,7 @@ void AliITSvBeamTestITS04::SetDefaults()
        seg0->SetBinSize(bx,bz);               // Based on AliITSgeomSPD for now.
        SetSegmentationModel(kSPD,seg0);
        // set digit and raw cluster classes to be used
-       const char *kData0=(fDetTypeSim->GetResponseModel(nspd))->DataType();
+       const char *kData0=(fDetTypeSim->GetResponseModel(kSPD))->DataType();
        if (strstr(kData0,"real")) 
          fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit");
        else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
@@ -440,25 +433,18 @@ void AliITSvBeamTestITS04::SetDefaults()
    
     s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info.
     if (s1) {
-      AliITSresponseSDD *resp1=0;
-      Int_t nsdd=0;
-      for(Int_t nmod=0;nmod<GetITSgeom()->GetIndexMax();nmod++){
-       if(GetITSgeom()->GetModuleType(nmod)==kSDD){
-         resp1 = new AliITSresponseSDD("simulated");
-         SetResponseModel(nmod,resp1);
-         nsdd=nmod;
-       }
-      }
-       AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(GetITSgeom(),resp1);
-       seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
-                        s1->GetDz()*4.*kconv, // for now.
-                        s1->GetDy()*4.*kconv); // x,z,y full width in microns.
-       seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
-       SetSegmentationModel(kSDD,seg1);
-       const char *kData1=(fDetTypeSim->GetResponseModel(nsdd))->DataType();
-       const char *kopt=fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD())->ZeroSuppOption();
-       if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
-         fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
+      AliITSresponseSDD *resp1=new AliITSresponseSDD("simulated");
+      SetResponseModel(kSDD,resp1);
+      AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(GetITSgeom(),resp1);
+      seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
+                      s1->GetDz()*4.*kconv, // for now.
+                      s1->GetDy()*4.*kconv); // x,z,y full width in microns.
+      seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
+      SetSegmentationModel(kSDD,seg1);
+      const char *kData1=(fDetTypeSim->GetResponseModel(kSDD))->DataType();
+      const char *kopt=fDetTypeSim->GetResponseModel(kSDD)->ZeroSuppOption();
+      if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
+       fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
        } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
     }
     
@@ -466,15 +452,8 @@ void AliITSvBeamTestITS04::SetDefaults()
     
     s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now.
     if (s2) {
-      AliITSresponse *resp2=0;
-      Int_t nssd=0;
-      for(Int_t nmod=0;nmod<GetITSgeom()->GetIndexMax();nmod++){
-       if(GetITSgeom()->GetModuleType(nmod)==kSSD){
-         resp2 = new AliITSresponseSSD("simulated");
-         SetResponseModel(nmod,resp2);
-         nssd=nmod;
-       }
-      }
+      AliITSresponse *resp2=new AliITSresponseSSD("simulated");
+      SetResponseModel(kSSD,resp2);
 
       AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(GetITSgeom());
       seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
@@ -486,7 +465,7 @@ void AliITSvBeamTestITS04::SetDefaults()
       seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
       seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
       SetSegmentationModel(kSSD,seg2); 
-      const char *kData2=(fDetTypeSim->GetResponseModel(nssd))->DataType();
+      const char *kData2=(fDetTypeSim->GetResponseModel(kSSD))->DataType();
       if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
       else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
     }
index e1e786500994f77da54f82fbecd7d8dca4af0d6f..cd64b78ee928fa46158c7dc370e92af6f1f3013f 100644 (file)
@@ -5181,11 +5181,9 @@ void AliITSvPPRasymmFMD::SetDefaults(){
     fDetTypeSim->ResetSegmentation();
     //SPD
     s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);// Get shape info. Do it this way for now.
-    AliITSresponseSPD* resp0=0;
-    for(Int_t nspd=GetITSgeom()->GetStartSPD();nspd<=GetITSgeom()->GetLastSPD();nspd++){
-      resp0 = new AliITSresponseSPD();
-      SetResponseModel(nspd,resp0);
-    }
+    AliITSresponseSPD* resp0=new AliITSresponseSPD();
+    SetResponseModel(kSPD,resp0);
+
     AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(GetITSgeom());
     seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
                     s0->GetDz()*2.*kconv, // for now.
@@ -5202,17 +5200,14 @@ void AliITSvPPRasymmFMD::SetDefaults(){
     seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
     SetSegmentationModel(kSPD,seg0);
     // set digit and raw cluster classes to be used
-    const char *kData0=(fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSPD()))->DataType();
+    const char *kData0=(fDetTypeSim->GetResponseModel(kSPD))->DataType();
     if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit");
     else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
 
     // SDD
     s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info. Do it this way for now.
-    AliITSresponseSDD* resp1=0;
-    for(Int_t nsdd=GetITSgeom()->GetStartSDD();nsdd<=GetITSgeom()->GetLastSDD();nsdd++){
-      resp1 = new AliITSresponseSDD("simulated");
-      SetResponseModel(nsdd,resp1);
-    }
+    AliITSresponseSDD* resp1=new AliITSresponseSDD("simulated");
+    SetResponseModel(kSDD,resp1);
    
     AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(GetITSgeom(),resp1);
     seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
@@ -5220,16 +5215,15 @@ void AliITSvPPRasymmFMD::SetDefaults(){
                     s1->GetDy()*2.*kconv); // x,z,y full width in microns.
     seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
     SetSegmentationModel(kSDD,seg1);
-    const char *kData1=(fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD()))->DataType();
-    const char *kopt=fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSDD())->ZeroSuppOption();
+    const char *kData1=(fDetTypeSim->GetResponseModel(kSDD))->DataType();
+    const char *kopt=fDetTypeSim->GetResponseModel(kSDD)->ZeroSuppOption();
     if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
        fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
     } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
     // SSD  Layer 5
+
     s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now.
-    for(Int_t nssd=GetITSgeom()->GetStartSSD();nssd<=GetITSgeom()->GetLastSSD();nssd++){
-      SetResponseModel(nssd,new AliITSresponseSSD("simulated"));
-    }
+    SetResponseModel(kSSD,new AliITSresponseSSD("simulated"));
     
     AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(GetITSgeom());
     seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
@@ -5241,7 +5235,7 @@ void AliITSvPPRasymmFMD::SetDefaults(){
     seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
     seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
     SetSegmentationModel(kSSD,seg2); 
-    const char *kData2=(fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSSD()))->DataType();
+    const char *kData2=(fDetTypeSim->GetResponseModel(kSSD))->DataType();
     if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
     else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
     if(fgkNTYPES>3){
index fdfa46b890e0a97b7c513fc24ada11f692575e9d..a0a15acb2811e7a5f62729e2be4af766c1ff9614 100644 (file)
@@ -845,26 +845,14 @@ void AliITSvSDD03::SetDefaults(){
  
     AliITSgeomSDD *s1;
     AliITSgeomSSD *s2;
-    for(Int_t nmod=0;nmod<GetITSgeom()->GetIndexMax();nmod++){
-      if(GetITSgeom()->GetModuleType(nmod)==kSPD)SetResponseModel(nmod,new AliITSresponseSPD());
-    }
-
+    SetResponseModel(kSPD,new AliITSresponseSPD());
     SetSegmentationModel(kSPD,new AliITSsegmentationSPD());
     fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
 
     // SDD
     s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info. Do it this way for now.
-    AliITSresponseSDD *resp1=0;
-    Int_t nsdd=0;
-
-    for(Int_t nmod=0;nmod<GetITSgeom()->GetIndexMax();nmod++){
-      if(GetITSgeom()->GetModuleType(nmod)==kSDD){
-       resp1 = new AliITSresponseSDD("simulated");
-       SetResponseModel(nmod,resp1);
-       nsdd=nmod;
-      }
-    }
-
+    AliITSresponseSDD *resp1=new AliITSresponseSDD("simulated");
+    SetResponseModel(kSDD,resp1);
 
     AliITSsegmentationSDD *seg1=new AliITSsegmentationSDD(GetITSgeom(),resp1);
     seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD
@@ -873,8 +861,8 @@ void AliITSvSDD03::SetDefaults(){
 
     seg1->SetNPads(256,256);// Use AliITSgeomSDD for now
     SetSegmentationModel(kSDD,seg1);
-    const char *kData1=(fDetTypeSim->GetResponseModel(nsdd))->DataType();
-    const char *kopt=fDetTypeSim->GetResponseModel(nsdd)->ZeroSuppOption();
+    const char *kData1=(fDetTypeSim->GetResponseModel(kSDD))->DataType();
+    const char *kopt=fDetTypeSim->GetResponseModel(kSDD)->ZeroSuppOption();
     if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){
        fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit");
     } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD");
@@ -883,16 +871,8 @@ void AliITSvSDD03::SetDefaults(){
 
     s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now.
    
-    AliITSresponse *resp2=0;
-    Int_t nssd=0;                      
-    for(Int_t nmod=0;nmod<GetITSgeom()->GetIndexMax();nmod++){
-      if(GetITSgeom()->GetModuleType(nmod)==kSSD){
-       resp2 = new AliITSresponseSSD("simulated");
-       SetResponseModel(nmod,resp2);
-       nssd=nmod;
-      }
-    }
-
+    AliITSresponse *resp2= new AliITSresponseSSD("simulated");
+    SetResponseModel(kSSD,resp2);
 
     AliITSsegmentationSSD *seg2=new AliITSsegmentationSSD(GetITSgeom());
     seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD
@@ -906,7 +886,7 @@ void AliITSvSDD03::SetDefaults(){
     seg2->SetAnglesLay6(0.,0.); // strip angles rad P and N side.
 
     SetSegmentationModel(kSSD,seg2); 
-    const char *kData2=(fDetTypeSim->GetResponseModel(nsdd))->DataType();
+    const char *kData2=(fDetTypeSim->GetResponseModel(kSSD))->DataType();
     if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
     else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
 
@@ -930,27 +910,19 @@ void AliITSvSDD03::SetDefaultSimulation(){
   AliITSsimulation *sim;
   AliITSsegmentation *seg;
   AliITSresponse *res;
-  Int_t nspd =0;
-  Int_t nsdd =0;
-  Int_t nssd =0;
-  for(Int_t i=0;i<GetITSgeom()->GetIndexMax();i++){
-    if(GetITSgeom()->GetModuleType(i)==kSPD) nspd=i;
-    if(GetITSgeom()->GetModuleType(i)==kSDD) nsdd=i;
-    if(GetITSgeom()->GetModuleType(i)==kSSD) nssd=i;    
-  }
   //SPD
   if(fDetTypeSim){
     sim = fDetTypeSim->GetSimulationModel(kSPD);
     if (!sim) {
       seg =(AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD);
       if(seg==0) seg = new AliITSsegmentationSPD();
-      res = (AliITSresponse*)fDetTypeSim->GetResponseModel(nspd);
+      res = (AliITSresponse*)fDetTypeSim->GetResponseModel(kSPD);
       if(res==0) res = new AliITSresponseSPD();
       sim = new AliITSsimulationSPDdubna(seg,res,0);
       SetSimulationModel(kSPD,sim);
     }else{ // simulation exists, make sure it is set up properly.
       sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD));
-      sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(nspd));
+      sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(kSPD));
       sim->Init();
     } // end if
   } // end if iDetType
@@ -959,12 +931,12 @@ void AliITSvSDD03::SetDefaultSimulation(){
     sim = fDetTypeSim->GetSimulationModel(kSDD);
     if (!sim) {
       seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD);
-      res = (AliITSresponse*)fDetTypeSim->GetResponseModel(nsdd);
+      res = (AliITSresponse*)fDetTypeSim->GetResponseModel(kSDD);
       sim = new AliITSsimulationSDD(seg,res);
       SetSimulationModel(kSDD,sim);
     }else{ // simulation exists, make sure it is set up properly.
       sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD));
-      sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(nsdd));
+      sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(kSDD));
       
       sim->Init();
     } //end if
@@ -974,12 +946,12 @@ void AliITSvSDD03::SetDefaultSimulation(){
     sim = fDetTypeSim->GetSimulationModel(kSSD);
     if (!sim) {
       seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD);
-      res = (AliITSresponse*)fDetTypeSim->GetResponseModel(nsdd);
+      res = (AliITSresponse*)fDetTypeSim->GetResponseModel(kSSD);
       sim = new AliITSsimulationSSD(seg,res);
       SetSimulationModel(kSSD,sim);
     }else{ // simulation exists, make sure it is set up properly.
       sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD));
-      sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(nssd));
+      sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(kSSD));
       sim->Init();
     } // end if
   } // end if iDetType
index f8622659ecb67719e1ea3b7f7e659cd183baecd5..5453dedffedbaad2fb095215951550189f89579b 100644 (file)
@@ -709,15 +709,11 @@ void AliITSvSPD02::SetDefaults(){
     //SPD
     // Get shape info. Do it this way for now.
     s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);
-    AliITSresponse *resp0=0;
-    for(Int_t nmod=0;nmod<GetITSgeom()->GetIndexMax();nmod++){      
-      if(GetITSgeom()->GetModuleType(nmod)==kSPD){
-       resp0 = new AliITSresponseSPD();
-       resp0->SetTemperature();
-       resp0->SetDistanceOverVoltage();
-       SetResponseModel(nmod,resp0);
-      }
-    }
+    AliITSresponse *resp0=new AliITSresponseSPD();
+    resp0->SetTemperature();
+    resp0->SetDistanceOverVoltage();
+    SetResponseModel(kSPD,resp0);
+       
     AliITSsegmentationSPD *seg0=new AliITSsegmentationSPD(GetITSgeom());
     seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD
                     s0->GetDz()*2.*kconv, // for now.
@@ -734,7 +730,7 @@ void AliITSvSPD02::SetDefaults(){
     seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
     SetSegmentationModel(kSPD,seg0);
     // set digit and raw cluster classes to be used
-    const char *kData0=(fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSPD()))->DataType();
+    const char *kData0=(fDetTypeSim->GetResponseModel(kSPD))->DataType();
     if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit");
     else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD");
 //    SetSimulationModel(kSPD,new AliITSsimulationSPDdubna(seg0,resp0));
@@ -774,22 +770,22 @@ void AliITSvSPD02::SetDefaultSimulation(){
   AliITSsimulation *sim;
   AliITSsegmentation *seg;
   AliITSresponse *res;
-    if(fDetTypeSim){
-        sim = fDetTypeSim->GetSimulationModel(kSPD);
-        if (!sim) {
-            seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD);
-            res = (AliITSresponse*)fDetTypeSim->GetResponseModel(GetITSgeom()->GetStartSPD());
-            sim = new AliITSsimulationSPDdubna(seg,res,0);
-            SetSimulationModel(kSPD,sim);
-        }else{ // simulation exists, make sure it is set up properly.
-         sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(kSPD));
-         sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD));
-         sim->Init();
-        } // end if
-    } // end if iDetType
-
+  if(fDetTypeSim){
+    sim = fDetTypeSim->GetSimulationModel(kSPD);
+    if (!sim) {
+      seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD);
+      res = (AliITSresponse*)fDetTypeSim->GetResponseModel(kSPD);
+      sim = new AliITSsimulationSPDdubna(seg,res,0);
+      SetSimulationModel(kSPD,sim);
+    }else{ // simulation exists, make sure it is set up properly.
+      sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(kSPD));
+      sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSPD));
+      sim->Init();
+    } // end if
+  } // end if iDetType
+  
     /*
-    if(fDetTypeSim){
+      if(fDetTypeSim){
         sim = fDetTypeSim->GetSimulationModel(kSDD);
         if (!sim) {
             seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSDD);
index aea257c23f4d43133eb81661307d2e85d0be0bfb..e117daf6d75a53b2edd14ec2f6d992084a7ef426 100644 (file)
@@ -645,17 +645,8 @@ void AliITSvSSD03::SetDefaults(){
 
     // Get shape info. Do it this way for now.
     s0 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);
-    AliITSresponse *resp0=0;
-    Int_t nssd=0;
-    
-    for(Int_t nmod=0;nmod<GetITSgeom()->GetIndexMax();nmod++){
-      if(GetITSgeom()->GetModuleType(nmod)==kSSD){
-       resp0= new AliITSresponseSSD("simulated");
-       SetResponseModel(nmod,resp0);   
-       nssd=nmod;
-      }
-    }
-
+    AliITSresponse *resp0=new AliITSresponseSSD("simulated");
+    SetResponseModel(kSSD,resp0);      
 
     AliITSsegmentationSSD *seg0=new AliITSsegmentationSSD(GetITSgeom());
     seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSSD
@@ -666,7 +657,7 @@ void AliITSvSSD03::SetDefaults(){
     SetSegmentationModel(kSSD,seg0);
 
     // set digit and raw cluster classes to be used
-    const char *kData0=(fDetTypeSim->GetResponseModel(nssd))->DataType();
+    const char *kData0=(fDetTypeSim->GetResponseModel(kSSD))->DataType();
     if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit");
     else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD");
 //    SetSimulationModel(kSSD,new AliITSsimulationSSD(seg0,resp0));
@@ -704,14 +695,6 @@ void AliITSvSSD03::SetDefaultSimulation(){
   AliITSsimulation *sim;
   AliITSsegmentation *seg;
   AliITSresponse *res;
-  Int_t nspd=0;
-  Int_t nsdd=0;
-  Int_t nssd=0;
-  for(Int_t i=0;i<GetITSgeom()->GetIndexMax();i++){
-    if(GetITSgeom()->GetModuleType(i)==kSPD) nspd=i;
-    if(GetITSgeom()->GetModuleType(i)==kSDD) nsdd=i;
-    if(GetITSgeom()->GetModuleType(i)==kSSD) nssd=i;
-  }
   /*
   //SPD
   if(fDetTypeSim){
@@ -757,12 +740,12 @@ void AliITSvSSD03::SetDefaultSimulation(){
     sim = fDetTypeSim->GetSimulationModel(kSSD);
     if (!sim) {
       seg = (AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD);
-      res = (AliITSresponse*)fDetTypeSim->GetResponseModel(nssd);
+      res = (AliITSresponse*)fDetTypeSim->GetResponseModel(kSSD);
       sim = new AliITSsimulationSSD(seg,res);
       SetSimulationModel(kSSD,sim);
     }else{ // simulation exists, make sure it is set up properly.
       sim->SetSegmentationModel((AliITSsegmentation*)fDetTypeSim->GetSegmentationModel(kSSD));
-      sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(nssd));
+      sim->SetResponseModel((AliITSresponse*)fDetTypeSim->GetResponseModel(kSSD));
       ((AliITSsimulation*)sim)->Init();
       //        if(sim->GetResponseModel()==0) sim->SetResponseModel(
       //            (AliITSresponse*)iDetType->GetResponseModel());