Possibility to trigger on the "bottom scintillator" (A. Dainese)
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Feb 2008 12:47:39 +0000 (12:47 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Feb 2008 12:47:39 +0000 (12:47 +0000)
EVGEN/AliGenCosmicsParam.cxx
EVGEN/AliGenCosmicsParam.h

index 07a2978..3622700 100644 (file)
@@ -45,7 +45,8 @@ fSDDouter(kFALSE),
 fSSDinner(kFALSE),
 fSSDouter(kFALSE),
 fACORDE(kFALSE),
-fACORDE4ITS(kFALSE)
+fACORDE4ITS(kFALSE),
+fBottomScintillator(kFALSE)
 {
   //
   // Default constructor
@@ -156,10 +157,15 @@ void AliGenCosmicsParam::Generate()
 
       // acceptance trigger
       if(IntersectCylinder(rtrigger,ztrigger,ipart,origin,p)) {
-       if(!fACORDE) {
-         break; 
-       } else {
+       if(fACORDE && !fBottomScintillator) {
          if(IntersectACORDE(ipart,origin,p)) break;
+       } else if(!fACORDE && fBottomScintillator) {
+         if(IntersectBottomScintillator(ipart,origin,p)) break;
+       } else if(fACORDE && fBottomScintillator) {
+         if(IntersectACORDE(ipart,origin,p) &&
+            IntersectBottomScintillator(ipart,origin,p)) break;
+       } else { // !fACORDE && !fBottomScintillator
+         break;
        }
       }
       //
@@ -241,14 +247,19 @@ Bool_t AliGenCosmicsParam::IntersectACORDE(Int_t pdg,
   //
 
   Float_t en = TMath::Sqrt(0.105*0.105+p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
-  TParticle part(pdg,0,0,0,0,0,p[0],p[1],p[2],en,o[0],o[1],o[2],0);
+  TParticle part(pdg,0,0,0,0,0,-p[0],-p[1],-p[2],en,o[0],o[1],o[2],0);
   AliESDtrack track(&part);
 
-  Float_t rACORDE=800.0,xACORDE=750.0,zACORDE=500.0;
+  Float_t rACORDE=800.0,xACORDE=750.0/*250.0*/,zACORDE=500.0;
   if(fACORDE4ITS) { xACORDE=100.0; zACORDE=100.0; }
 
-  Double_t xyz[3];
-  track.GetXYZAt(rACORDE,fBkG,xyz);
+  Double_t planepoint[3]={0.,rACORDE,0.};
+  Double_t planenorm[3]={0.,1.,0.};
+
+  if(!track.Intersect(planepoint,planenorm,fBkG)) return kFALSE;
+
+  Double_t xyz[3]={planepoint[0],planepoint[1],planepoint[2]};
+  //printf("XYZ = %f %f  %f\n",xyz[0],xyz[1],xyz[2]);
 
   // check global x 
   if(TMath::Abs(xyz[0]) > xACORDE) return kFALSE;
@@ -258,3 +269,32 @@ Bool_t AliGenCosmicsParam::IntersectACORDE(Int_t pdg,
   return kTRUE;
 }
 //-----------------------------------------------------------------------------
+Bool_t AliGenCosmicsParam::IntersectBottomScintillator(Int_t pdg,
+                                          Float_t o[3],Float_t p[3]) const
+{
+  //
+  // Intersection between muon and ACORDE (very rough)
+  //
+
+  Float_t en = TMath::Sqrt(0.105*0.105+p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
+  TParticle part(pdg,0,0,0,0,0,-p[0],-p[1],-p[2],en,o[0],o[1],o[2],0);
+  AliESDtrack track(&part);
+
+  Double_t xSc=40.,ySc=-350.,zSc=40.;
+
+  Double_t planepoint[3]={0.,ySc,0.};
+  Double_t planenorm[3]={0.,1.,0.};
+
+  if(!track.Intersect(planepoint,planenorm,fBkG)) return kFALSE;
+
+  Double_t xyz[3]={planepoint[0],planepoint[1],planepoint[2]};
+  //printf("XYZ = %f %f  %f\n",xyz[0],xyz[1],xyz[2]);
+
+  // check global x 
+  if(TMath::Abs(xyz[0]) > xSc) return kFALSE;
+  // check global z
+  if(TMath::Abs(xyz[2]) > zSc) return kFALSE;
+
+  return kTRUE;
+}
+//-----------------------------------------------------------------------------
index 1207844..1a878d6 100644 (file)
@@ -28,6 +28,7 @@ public:
   void SetBkG(Float_t b) { fBkG=b; return; }
   void SetInACORDE(Bool_t onlyACORDE4ITS=kFALSE) 
     { fACORDE=kTRUE; fACORDE4ITS=onlyACORDE4ITS; return; }
+  void SetInBottomScintillator() { fBottomScintillator=kTRUE; return; }
   void SetInTPC() { fTPC=kTRUE; return; }
   void SetInITS() { fITS=kTRUE; return; }
   void SetInSPDinner() { fSPDinner=kTRUE; return; }
@@ -43,6 +44,8 @@ private:
                           Float_t o[3],Float_t p[3]) const;  
   Bool_t IntersectACORDE(Int_t pdg,
                         Float_t o[3],Float_t p[3]) const;
+  Bool_t IntersectBottomScintillator(Int_t pdg,
+                                    Float_t o[3],Float_t p[3]) const; 
   Bool_t fParamMI;              // parametrization from M.Ivanov
   Bool_t fParamACORDE;          // parametrization from AliGenACORDE 
                                 // (parametrized at ALICE y)
@@ -59,8 +62,9 @@ private:
   Bool_t fSSDouter;             // acceptance cuts
   Bool_t fACORDE;               // acceptance cuts
   Bool_t fACORDE4ITS;           // acceptance cuts
+  Bool_t fBottomScintillator;   // acceptance cuts
 
-  ClassDef(AliGenCosmicsParam,3) // parametrized cosmics generator
+  ClassDef(AliGenCosmicsParam,4) // parametrized cosmics generator
 };
 
 #endif