]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - VZERO/AliVZEROv7.cxx
Updated calibration (Brigitte)
[u/mrichter/AliRoot.git] / VZERO / AliVZEROv7.cxx
index 8966a8996aa12ddfc448ad4548696dc33c66dba1..5d3fe214b501e3c0a26df3046ec91bc7023e2fa5 100644 (file)
 ClassImp(AliVZEROv7)
 
 //_____________________________________________________________________________
-AliVZEROv7:: AliVZEROv7():AliVZERO()
+AliVZEROv7:: AliVZEROv7():AliVZERO(),
+   fCellId(0),
+   fTrackPosition(),
+   fTrackMomentum(), 
+   fV0CHeight1(2.5), 
+   fV0CHeight2(4.4), 
+   fV0CHeight3(7.4), 
+   fV0CHeight4(12.5),
+   fV0CRMin(4.6), 
+   fV0CRBox(38.0),
+   fV0CLidThickness(0.30),
+   fV0CCellThickness(2.00),
+   fV0CBoxThickness(4.70),
+   fV0COffsetFibers(1.0),
+   fV0CLightYield(93.75),
+   fV0CLightAttenuation(0.05),
+   fV0CnMeters(15.0),
+   fV0CFibToPhot(0.3),
+   fV0AR0(4.2), 
+   fV0AR1(7.6), 
+   fV0AR2(13.8), 
+   fV0AR3(22.7),
+   fV0AR4(41.3), 
+   fV0AR5(43.3), 
+   fV0AR6(68.0),
+   fV0ASciWd(2.5), 
+   fV0APlaWd(0.5), 
+   fV0APlaAl(0.06), 
+   fV0AOctWd(0.75), 
+   fV0AFraWd(0.2),
+   fV0AOctH1(1.0), 
+   fV0AOctH2(2.0), 
+   fV0ABasHt(2.0),
+   fV0AFibRd(0.1),
+   fV0APlaEx(4.4),
+   fV0APMBWd(24.6), 
+   fV0APMBHt(22.0), 
+   fV0APMBTh(7.1), 
+   fV0APMBWdW(0.3), 
+   fV0APMBHtW(1.0),
+   fV0APMBAng(30.0), 
+   fV0APMBThW(0.3), 
+   fV0APMTR1(2.44), 
+   fV0APMTR2(2.54), 
+   fV0APMTR3(2.54),
+   fV0APMTR4(2.70), 
+   fV0APMTH(10.0), 
+   fV0APMTB(1.0),
+   fV0AnMeters(fV0AR6*0.01),
+   fV0ALightYield(93.75),
+   fV0ALightAttenuation(0.05),
+   fV0AFibToPhot(0.3),
+   fVersion(7)
 {
 // Standard default constructor 
 }
 
 //_____________________________________________________________________________
-AliVZEROv7::AliVZEROv7(const char *name, const char *title):AliVZERO(name,title)
+AliVZEROv7::AliVZEROv7(const char *name, const char *title):AliVZERO(name,title),
+   fCellId(0),
+   fTrackPosition(),
+   fTrackMomentum(), 
+   fV0CHeight1(2.5), 
+   fV0CHeight2(4.4), 
+   fV0CHeight3(7.4), 
+   fV0CHeight4(12.5),
+   fV0CRMin(4.6), 
+   fV0CRBox(38.0),
+   fV0CLidThickness(0.30),
+   fV0CCellThickness(2.00),
+   fV0CBoxThickness(4.70),
+   fV0COffsetFibers(1.0),
+   fV0CLightYield(93.75),
+   fV0CLightAttenuation(0.05),
+   fV0CnMeters(15.0),
+   fV0CFibToPhot(0.3),
+   fV0AR0(4.2), 
+   fV0AR1(7.6), 
+   fV0AR2(13.8), 
+   fV0AR3(22.7),
+   fV0AR4(41.3), 
+   fV0AR5(43.3), 
+   fV0AR6(68.0),
+   fV0ASciWd(2.5), 
+   fV0APlaWd(0.5), 
+   fV0APlaAl(0.06), 
+   fV0AOctWd(0.75), 
+   fV0AFraWd(0.2),
+   fV0AOctH1(1.0), 
+   fV0AOctH2(2.0), 
+   fV0ABasHt(2.0),
+   fV0AFibRd(0.1),
+   fV0APlaEx(4.4),
+   fV0APMBWd(24.6), 
+   fV0APMBHt(22.0), 
+   fV0APMBTh(7.1), 
+   fV0APMBWdW(0.3), 
+   fV0APMBHtW(1.0),
+   fV0APMBAng(30.0), 
+   fV0APMBThW(0.3), 
+   fV0APMTR1(2.44), 
+   fV0APMTR2(2.54), 
+   fV0APMTR3(2.54),
+   fV0APMTR4(2.70), 
+   fV0APMTH(10.0), 
+   fV0APMTB(1.0),
+   fV0AnMeters(fV0AR6*0.01),
+   fV0ALightYield(93.75),
+   fV0ALightAttenuation(0.05),
+   fV0AFibToPhot(0.3),
+   fVersion(7)
+
+
 {
 // Standard constructor for V-zero Detector  version 7
 
   AliDebug(2,"Create VZERO object ");
-  fVersion            =     7;  // version number
-
-  // V0C Parameters related to geometry: All in cm
-  fV0CHeight1         =    2.5; // height of cell 1
-  fV0CHeight2         =    4.4; // height of cell 2
-  fV0CHeight3         =    7.4; // height of cell 3
-  fV0CHeight4         =   12.5; // height of cell 4
-  fV0CRMin            =    4.6; // inner radius of box
-  fV0CRBox            =   38.0; // outer radius of box
-  fV0CLidThickness    =   0.30; // thickness of Carbon lid
-  fV0CCellThickness   =   2.00; // thickness of elementary cell
-  fV0CBoxThickness    =   4.70; // thickness of V0C Box
-  fV0COffsetFibers    =    1.0; // offset to output fibers
-  // V0C Parameters related to light output
-  fV0CLightYield         =  93.75; // Light yield in BC408 (93.75 eV per photon)
-  fV0CLightAttenuation   =   0.05; // Light attenuation in fiber (0.05 per meter)
-  fV0CnMeters            =   15.0; // Number of meters of clear fibers to PM
-  fV0CFibToPhot          =    0.3; // Attenuation at fiber-photocathode interface
-
-  // V0A Parameters related to geometry: All in cm
-  fV0AR0     =  4.2;  // Radius of hole
-  fV0AR1     =  7.6;  // Maximun radius of 1st cell
-  fV0AR2     = 13.8; // Maximun radius of 2nd cell
-  fV0AR3     = 22.7; // Maximun radius of 3rd cell
-  fV0AR4     = 41.3; // Maximun radius of 4th cell
-  fV0AR5     = 43.3; // Radius circunscrite to innermost octagon
-  fV0AR6     = 68.0; // Radius circunscrite to outtermost octagon
-  fV0ASciWd  =  2.5;  // Scintillator thickness 
-  fV0APlaWd  =  0.5;  // Plates thinckness
-  fV0APlaAl  = 0.06; // Plates AlMg3 thinckness
-  fV0AOctWd  = 0.75; // Innermost octagon thickness
-  fV0AOctH1  =  1.0;  // Height of innermost octagon
-  fV0AOctH2  =  2.0;  // Height of outtermost octagon
-  fV0AFibRd  =  0.1;  // Radius of Fiber
-  fV0AFraWd  =  0.2;  // Support Frame thickness
-  fV0APMBWd  = 24.6;  // Width of PM Box
-  fV0APMBHt  = 22.0;  // Height of PM Box
-  fV0APMBTh  =  7.1;  // Thickness of PM Box
-  fV0APMBWdW =  0.3;  // Thickness of PM Box Side1 Wall
-  fV0APMBHtW =  1.0;  // Thickness of PM Box Side2 Wall
-  fV0APMBThW =  0.3;  // Thickness of PM Box Top Wall
-  fV0APMBAng = 30.0;  // Angle between PM Box and Support
-  fV0APMTR1  = 2.44;  // PMT Glass
-  fV0APMTR2  = 2.54;  // PMT Glass
-  fV0APMTR3  = 2.54;  // PMT Cover
-  fV0APMTR4  = 2.70;  // PMT Cover
-  fV0APMTH   = 10.0;  // PMT Height
-  fV0APMTB   =  1.0;  // PMT Basis
-  fV0APlaEx  =  4.4;  // Plates Extension height
-  fV0ABasHt  =  2.0;  // Basis Height
-  // V0A Parameters related to light output
-  fV0ALightYield         =  93.75;      // Light yield in BC404
-  fV0ALightAttenuation   =   0.05;      // Light attenuation in WLS fiber, per meter
-  fV0AnMeters            = fV0AR6*0.01; // Tentative value, in meters
-  fV0AFibToPhot          =    0.3;      // Attenuation at fiber-photocathode interface
+
+//  fVersion            =     7;  // version number
+
+//   // V0C Parameters related to geometry: All in cm
+//   fV0CHeight1         =    2.5; // height of cell 1
+//   fV0CHeight2         =    4.4; // height of cell 2
+//   fV0CHeight3         =    7.4; // height of cell 3
+//   fV0CHeight4         =   12.5; // height of cell 4
+//   fV0CRMin            =    4.6; // inner radius of box
+//   fV0CRBox            =   38.0; // outer radius of box
+//   fV0CLidThickness    =   0.30; // thickness of Carbon lid
+//   fV0CCellThickness   =   2.00; // thickness of elementary cell
+//   fV0CBoxThickness    =   4.70; // thickness of V0C Box
+//   fV0COffsetFibers    =    1.0; // offset to output fibers
+//   // V0C Parameters related to light output
+//   fV0CLightYield         =  93.75; // Light yield in BC408 (93.75 eV per photon)
+//   fV0CLightAttenuation   =   0.05; // Light attenuation in fiber (0.05 per meter)
+//   fV0CnMeters            =   15.0; // Number of meters of clear fibers to PM
+//   fV0CFibToPhot          =    0.3; // Attenuation at fiber-photocathode interface
+// 
+//   // V0A Parameters related to geometry: All in cm
+//   fV0AR0     =  4.2;  // Radius of hole
+//   fV0AR1     =  7.6;  // Maximun radius of 1st cell
+//   fV0AR2     = 13.8; // Maximun radius of 2nd cell
+//   fV0AR3     = 22.7; // Maximun radius of 3rd cell
+//   fV0AR4     = 41.3; // Maximun radius of 4th cell
+//   fV0AR5     = 43.3; // Radius circunscrite to innermost octagon
+//   fV0AR6     = 68.0; // Radius circunscrite to outtermost octagon
+//   fV0ASciWd  =  2.5;  // Scintillator thickness 
+//   fV0APlaWd  =  0.5;  // Plates thinckness
+//   fV0APlaAl  = 0.06; // Plates AlMg3 thinckness
+//   fV0AOctWd  = 0.75; // Innermost octagon thickness
+//   fV0AOctH1  =  1.0;  // Height of innermost octagon
+//   fV0AOctH2  =  2.0;  // Height of outtermost octagon
+//   fV0AFibRd  =  0.1;  // Radius of Fiber
+//   fV0AFraWd  =  0.2;  // Support Frame thickness
+//   fV0APMBWd  = 24.6;  // Width of PM Box
+//   fV0APMBHt  = 22.0;  // Height of PM Box
+//   fV0APMBTh  =  7.1;  // Thickness of PM Box
+//   fV0APMBWdW =  0.3;  // Thickness of PM Box Side1 Wall
+//   fV0APMBHtW =  1.0;  // Thickness of PM Box Side2 Wall
+//   fV0APMBThW =  0.3;  // Thickness of PM Box Top Wall
+//   fV0APMBAng = 30.0;  // Angle between PM Box and Support
+//   fV0APMTR1  = 2.44;  // PMT Glass
+//   fV0APMTR2  = 2.54;  // PMT Glass
+//   fV0APMTR3  = 2.54;  // PMT Cover
+//   fV0APMTR4  = 2.70;  // PMT Cover
+//   fV0APMTH   = 10.0;  // PMT Height
+//   fV0APMTB   =  1.0;  // PMT Basis
+//   fV0APlaEx  =  4.4;  // Plates Extension height
+//   fV0ABasHt  =  2.0;  // Basis Height
+//   // V0A Parameters related to light output
+//   fV0ALightYield         =  93.75;      // Light yield in BC404
+//   fV0ALightAttenuation   =   0.05;      // Light attenuation in WLS fiber, per meter
+//   fV0AnMeters            = fV0AR6*0.01; // Tentative value, in meters
+//   fV0AFibToPhot          =    0.3;      // Attenuation at fiber-photocathode interface
 }
 //_____________________________________________________________________________
 
@@ -393,10 +500,10 @@ void AliVZEROv7::CreateGeometry()
     TGeoVolume *v0L4 = new TGeoVolume("V0L4",sV0AR4,medV0ASci);
     v0L1->SetLineColor(kV0AColorSci); v0L2->SetLineColor(kV0AColorSci);
     v0L3->SetLineColor(kV0AColorSci); v0L4->SetLineColor(kV0AColorSci);
-    v0ASci->AddNode(v0L1,1);
-    v0ASci->AddNode(v0L2,1);
-    v0ASci->AddNode(v0L3,1);
-    v0ASci->AddNode(v0L4,1);
+    v0ASec->AddNode(v0L1,1);
+    v0ASec->AddNode(v0L2,1);
+    v0ASec->AddNode(v0L3,1);
+    v0ASec->AddNode(v0L4,1);
 
     /// Non-sensitive scintilator
     for (int i=0;i<2;i++) {
@@ -536,8 +643,8 @@ void AliVZEROv7::CreateGeometry()
     /// Replicate sectors
     TGeoVolume *v0LE = new TGeoVolumeAssembly("V0LE");
     for(int i=0; i<8; i++) {
-      TGeoRotation *rot = new TGeoRotation("rot", 90., i*45., 90., 90.+i*45., 0., 0.);
-      v0LE->AddNode(v0ASec,i,rot);
+      TGeoRotation *rot = new TGeoRotation("rot", 90., i*45.+90, 90., 90.+i*45.+90, 0., 0.);
+      v0LE->AddNode(v0ASec,i+1,rot);  /// modificacion +1 anhadido
     }
   
     /// Basis Construction
@@ -592,6 +699,27 @@ void AliVZEROv7::CreateGeometry()
     vZERO->AddNode(v0LE,1,new TGeoTranslation(0, 0, +340));
     top->AddNode(vZERO,1);
 }
+
+//_____________________________________________________________________________
+void AliVZEROv7::AddAlignableVolumes() const
+{
+  //
+  // Create entries for alignable volumes associating the symbolic volume
+  // name with the corresponding volume path. Needs to be syncronized with
+  // eventual changes in the geometry.
+  // 
+  TString vpC = "/ALIC_1/VZERO_1/V0RI_1";
+  TString vpA = "/ALIC_1/VZERO_1/V0LE_1";
+  TString snC = "VZERO/V0C";
+  TString snA = "VZERO/V0A";
+  
+  if(!gGeoManager->SetAlignableEntry(snC.Data(),vpC.Data()))
+    AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", snC.Data(),vpC.Data()));
+  if(!gGeoManager->SetAlignableEntry(snA.Data(),vpA.Data()))
+    AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", snA.Data(),vpA.Data()));
+
+} 
+
 //_____________________________________________________________________________
 void AliVZEROv7::CreateMaterials()
 {
@@ -740,7 +868,9 @@ void AliVZEROv7::Init()
 // Initialises version of the VZERO Detector given in Config
 // Just prints an information message
 
-   AliInfo(Form("VZERO version %d initialized \n",IsVersion()));
+//   AliInfo(Form("VZERO version %d initialized \n",IsVersion()));
+   
+   AliDebug(1,"VZERO version 7 initialized");
    AliVZERO::Init();  
 }
 
@@ -776,7 +906,7 @@ void AliVZEROv7::StepManager()
   static Int_t idV0L4 = gMC->VolId("V0L4");
   static Int_t idV0R5 = gMC->VolId("V0R5");
   static Int_t idV0R6 = gMC->VolId("V0R6");
-  bool   hitOnV0C = false;
+  bool   hitOnV0C = true;
   double lightYield;
   double lightAttenuation;
   double nMeters;
@@ -805,7 +935,7 @@ void AliVZEROv7::StepManager()
       lightYield = fV0ALightYield;
       lightAttenuation = fV0ALightAttenuation;
       nMeters = fV0AnMeters;
-      fibToPhot = fV0CFibToPhot;
+      fibToPhot = fV0AFibToPhot;
     }
     nPhotonsInStep  = Int_t(destep / (lightYield *1e-9) );     
     nPhotonsInStep  = gRandom->Poisson(nPhotonsInStep);
@@ -837,6 +967,17 @@ void AliVZEROv7::StepManager()
       hits[16] = par->Vz();
       tlength  = 0.0;
       eloss    = 0.0;      
+
+      //////////////////////////
+      ///// Display V0A geometry
+      //      if (!hitOnV0C) {
+      //       FILE *of;
+      //       of = fopen("V0A.out", "a");
+      //       // x, y, z, ringnumber, cellid
+      //       fprintf( of, "%f %f %f %f %d \n",  hits[0], hits[1], hits[2], hits[8], GetCellId (vol, hits) );
+      //       fclose(of);
+      //      }
+      //////////////////////////
     }
     nPhotons  = nPhotons + nPhotonsInStep;
     if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
@@ -906,6 +1047,7 @@ Int_t AliVZEROv7::GetCellId(Int_t *vol, Float_t *hits)
   Int_t index      = vol[1];
   Int_t ringNumber = Int_t(hits[8]);
   fCellId          = 0;
+
   Float_t phi = Float_t(TMath::ATan2(Double_t(hits[1]),Double_t(hits[0])) ); 
   Float_t kRaddeg = 180.0/TMath::Pi();
   phi = kRaddeg * phi;
@@ -926,5 +1068,6 @@ Int_t AliVZEROv7::GetCellId(Int_t *vol, Float_t *hits)
     index = (index - 7 + 48) + ( ( ringNumber - 1 ) * 8);
     fCellId   = index;
   }
+
   return fCellId;
 }