Bug fix for SDD test beam simulation
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Mar 2004 18:56:29 +0000 (18:56 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Mar 2004 18:56:29 +0000 (18:56 +0000)
ITS/AliITSvSDD03.cxx
ITS/AliITSvSDD03.h

index 7e98357f1ad3d1fd9c393e1cb781995614fa000c..5d9a853e5e67c1fb2c1056b634d7bd501138d425 100644 (file)
@@ -702,6 +702,70 @@ void AliITSvSDD03::SetDefaults(){
     return;
 }
 //______________________________________________________________________
+void AliITSvSDD03::SetDefaultSimulation(){
+    // sets the default simulation.
+    // Inputs:
+    //      none.
+    // Outputs:
+    //      none.
+    // Return:
+    //      none.
+
+    AliITSDetType *iDetType;
+    AliITSsimulation *sim;
+    iDetType=DetType(kSPD);
+    sim = iDetType->GetSimulationModel();
+    if (!sim) {
+        AliITSsegmentation *seg0=
+            (AliITSsegmentation*)iDetType->GetSegmentationModel();
+        AliITSresponse *res0 = (AliITSresponse*)iDetType->GetResponseModel();
+        AliITSsimulationSPD *sim0=new AliITSsimulationSPD(seg0,res0);
+        SetSimulationModel(kSPD,sim0);
+    }else{ // simulation exists, make sure it is set up properly.
+        ((AliITSsimulationSPD*)sim)->Init(
+            (AliITSsegmentationSPD*) iDetType->GetSegmentationModel(),
+            (AliITSresponseSPD*) iDetType->GetResponseModel());
+//        if(sim->GetResponseModel()==0) sim->SetResponseModel(
+//            (AliITSresponse*)iDetType->GetResponseModel());
+//        if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
+//            (AliITSsegmentation*)iDetType->GetSegmentationModel());
+    } // end if
+    iDetType=DetType(kSDD);
+    sim = iDetType->GetSimulationModel();
+    if (!sim) {
+        AliITSsegmentation *seg1=
+            (AliITSsegmentation*)iDetType->GetSegmentationModel();
+        AliITSresponse *res1 = (AliITSresponse*)iDetType->GetResponseModel();
+        AliITSsimulationSDD *sim1=new AliITSsimulationSDD(seg1,res1);
+        SetSimulationModel(kSDD,sim1);
+    }else{ // simulation exists, make sure it is set up properly.
+        ((AliITSsimulationSDD*)sim)->Init(
+            (AliITSsegmentationSDD*) iDetType->GetSegmentationModel(),
+            (AliITSresponseSDD*) iDetType->GetResponseModel());
+//        if(sim->GetResponseModel()==0) sim->SetResponseModel(
+//            (AliITSresponse*)iDetType->GetResponseModel());
+//        if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
+//            (AliITSsegmentation*)iDetType->GetSegmentationModel());
+    } //end if
+    iDetType=DetType(kSSD);
+    sim = iDetType->GetSimulationModel();
+    if (!sim) {
+        AliITSsegmentation *seg2=
+            (AliITSsegmentation*)iDetType->GetSegmentationModel();
+        AliITSresponse *res2 = (AliITSresponse*)iDetType->GetResponseModel();
+        AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2);
+        SetSimulationModel(kSDD,sim2);
+    }else{ // simulation exists, make sure it is set up properly.
+        ((AliITSsimulationSSD*)sim)->Init(
+            (AliITSsegmentationSSD*) iDetType->GetSegmentationModel(),
+            (AliITSresponseSSD*) iDetType->GetResponseModel());
+//        if(sim->GetResponseModel()==0) sim->SetResponseModel(
+//            (AliITSresponse*)iDetType->GetResponseModel());
+//        if(sim->GetSegmentationModel()==0) sim->SetSegmentationModel(
+//            (AliITSsegmentation*)iDetType->GetSegmentationModel());
+    } // end if
+}
+//______________________________________________________________________
 void AliITSvSDD03::DrawModule(){
     ////////////////////////////////////////////////////////////////////////
     //     Draw a shaded view of the ITS SDD test beam version 1.
index 070684730c0c359af5118eef1f879aab4a6d5d2e..e4ead32ccb2875f4c0cee73654174ed1d18cae3d 100644 (file)
@@ -52,6 +52,9 @@ class AliITSvSDD03 : public AliITS{
     virtual void   SetThicknessChip2(Float_t v=300.){
          // Set chip thickness in layer 2
          fChip2 = v;}
+    // Replacement default simulation initilization.
+    virtual void SetDefaultSimulation();
+         //
  private:  
     void InitAliITSgeom();
     Bool_t fGeomDetOut;       // Flag to write .det file out