LCOV - code coverage report
Current view: top level - TRD/TRDsim - AliTRD.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 182 274 66.4 %
Date: 2016-06-14 17:26:59 Functions: 13 20 65.0 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : /* $Id$ */
      17             : 
      18             : ///////////////////////////////////////////////////////////////////////////////
      19             : //                                                                           //
      20             : //  Transition Radiation Detector                                            //
      21             : //  This class contains the basic functions for the Transition Radiation     //
      22             : //  Detector.                                                                //
      23             : //                                                                           //
      24             : ///////////////////////////////////////////////////////////////////////////////
      25             : 
      26             : #include <TGeoGlobalMagField.h>
      27             : #include <TVirtualMC.h>
      28             : #include <TGeoManager.h>
      29             :  
      30             : #include "AliMC.h"
      31             : #include "AliMagF.h"
      32             : #include "AliRun.h"
      33             : #include "AliLoader.h"
      34             : 
      35             : #include "AliTRD.h"
      36             : #include "AliTRDdigitizer.h"
      37             : #include "AliTRDdigitsManager.h"
      38             : #include "AliTRDgeometry.h"
      39             : #include "AliTRDhit.h"
      40             : #include "AliTRDrawData.h"
      41             : #include "AliTRDCommonParam.h"
      42             : 
      43          12 : ClassImp(AliTRD)
      44             :  
      45             : //_____________________________________________________________________________
      46             : AliTRD::AliTRD()
      47          12 :   :AliDetector()
      48          12 :   ,fGeometry(0)
      49          12 :   ,fGasDensity(0)
      50          12 :   ,fFoilDensity(0)
      51          12 :   ,fGasNobleFraction(0)
      52          12 :   ,fPrimaryIonisation(0)
      53          36 : {
      54             :   //
      55             :   // Default constructor
      56             :   //
      57             :  
      58          12 : }
      59             :  
      60             : //_____________________________________________________________________________
      61             : AliTRD::AliTRD(const char *name, const char *title)
      62           1 :   :AliDetector(name,title)
      63           1 :   ,fGeometry(0)
      64           1 :   ,fGasDensity(0)
      65           1 :   ,fFoilDensity(0)
      66           1 :   ,fGasNobleFraction(0)
      67           1 :   ,fPrimaryIonisation(0)
      68           3 : {
      69             :   //
      70             :   // Standard constructor for the TRD
      71             :   //
      72             : 
      73             :   // Check that FRAME is there otherwise we have no place where to put TRD
      74           1 :   AliModule *frame = gAlice->GetModule("FRAME");
      75           1 :   if (!frame) {
      76           0 :     AliError("TRD needs FRAME to be present\n");
      77           0 :     exit(1);
      78             :   } 
      79             : 
      80             :   // Define the TRD geometry
      81           2 :   if ((frame->IsVersion() == 0) ||
      82           0 :       (frame->IsVersion() == 1)) {
      83           3 :     fGeometry = new AliTRDgeometry();
      84             :   }
      85             :   else {
      86           0 :     AliError("Could not find valid FRAME version\n");
      87           0 :     exit(1);
      88             :   }
      89             : 
      90             :   // Allocate the hit array
      91           3 :   fHits = new TClonesArray("AliTRDhit",405);
      92           1 :   gAlice->GetMCApp()->AddHitList(fHits);
      93             : 
      94           1 : }
      95             : 
      96             : //_____________________________________________________________________________
      97             : AliTRD::~AliTRD()
      98          26 : {
      99             :   //
     100             :   // TRD destructor
     101             :   //
     102             : 
     103          13 :   if (fGeometry) {
     104          26 :     delete fGeometry;
     105          13 :     fGeometry = 0;
     106          13 :   }
     107             : 
     108          13 :   if (fHits) {
     109           6 :     delete fHits;
     110           3 :     fHits     = 0;
     111           3 :   }
     112             : 
     113          13 : }
     114             : 
     115             : //_____________________________________________________________________________
     116             : void AliTRD::Hits2Digits()
     117             : {
     118             :   //
     119             :   // Create digits
     120             :   //
     121             : 
     122           0 :   AliTRDdigitizer digitizer("TRDdigitizer","TRD digitizer class");
     123           0 :   AliLog::SetClassDebugLevel("TRDdigitizer",AliDebugLevel());
     124             : 
     125             :   // Initialization
     126           0 :   digitizer.InitDetector();
     127             :     
     128           0 :   if (!fLoader->TreeH()) {
     129           0 :     fLoader->LoadHits("read");
     130             :   }
     131           0 :   fLoader->LoadDigits("recreate");
     132             : 
     133           0 :   AliRunLoader *runLoader = fLoader->GetRunLoader(); 
     134             : 
     135           0 :   for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) {
     136           0 :     runLoader->GetEvent(iEvent);
     137           0 :     digitizer.Open(runLoader,iEvent);
     138           0 :     digitizer.MakeDigits();
     139           0 :     digitizer.WriteDigits();
     140             :   }
     141             : 
     142           0 :   fLoader->UnloadHits();
     143           0 :   fLoader->UnloadDigits();
     144             : 
     145           0 : }
     146             : 
     147             : //_____________________________________________________________________________
     148             : void AliTRD::Hits2SDigits()
     149             : {
     150             :   //
     151             :   // Create summable digits
     152             :   //
     153             : 
     154           2 :   AliTRDdigitizer digitizer("TRDdigitizer","TRD digitizer class");
     155             :   // For the summable digits
     156           1 :   digitizer.SetSDigits(kTRUE);
     157           4 :   AliLog::SetClassDebugLevel("TRDdigitizer",AliDebugLevel());
     158             : 
     159             :   // Initialization
     160           1 :   digitizer.InitDetector();
     161             :     
     162           2 :   if (!fLoader->TreeH()) {
     163           1 :     fLoader->LoadHits("read");
     164             :   }
     165           1 :   fLoader->LoadSDigits("recreate");
     166             : 
     167           1 :   AliRunLoader *runLoader = fLoader->GetRunLoader(); 
     168             : 
     169          15 :   for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) {
     170           4 :     runLoader->GetEvent(iEvent);
     171           4 :     digitizer.Open(runLoader,iEvent);
     172           4 :     digitizer.MakeDigits();
     173           4 :     digitizer.WriteDigits();
     174             :   }
     175             : 
     176           1 :   fLoader->UnloadHits();
     177           1 :   fLoader->UnloadSDigits();
     178             :   
     179           1 : }
     180             : 
     181             : //_____________________________________________________________________________
     182             : AliDigitizer *AliTRD::CreateDigitizer(AliDigitizationInput* digInput) const
     183             : {
     184             :   //
     185             :   // Creates a new digitizer object
     186             :   //
     187             : 
     188           3 :   return new AliTRDdigitizer(digInput);
     189             : 
     190           0 : }
     191             : 
     192             : //_____________________________________________________________________________
     193             : void AliTRD::SDigits2Digits()
     194             : {
     195             :   //
     196             :   // Create final digits from summable digits
     197             :   //
     198             : 
     199             :   // Create the TRD digitizer
     200           0 :   AliTRDdigitizer digitizer("TRDdigitizer","TRD digitizer class");  
     201           0 :   AliLog::SetClassDebugLevel("TRDdigitizer",AliDebugLevel());
     202             : 
     203             :   // Set the parameter
     204           0 :   digitizer.SetEvent(gAlice->GetEvNumber());
     205             : 
     206             :   // Initialization
     207           0 :   digitizer.InitDetector();
     208             : 
     209             :   // Read the s-digits via digits manager
     210           0 :   AliTRDdigitsManager sdigitsManager;
     211             :  
     212           0 :   AliLog::SetClassDebugLevel("TRDdigitisManager",AliDebugLevel());
     213           0 :   sdigitsManager.SetSDigits(kTRUE);
     214           0 :   sdigitsManager.CreateArrays();
     215             :   
     216           0 :   if (!fLoader->TreeS()) { 
     217           0 :     if (fLoader->LoadSDigits("read")) {
     218           0 :       return;
     219             :     }
     220             :   }
     221           0 :   if (!fLoader->TreeS()) {
     222           0 :     AliError(Form("Error while reading SDigits for event %d",gAlice->GetEvNumber()));
     223           0 :     return;
     224             :   }
     225             :   
     226           0 :   sdigitsManager.ReadDigits(fLoader->TreeS());
     227             : 
     228             :   // Add the s-digits to the input list 
     229           0 :   digitizer.AddSDigitsManager(&sdigitsManager);
     230             : 
     231             :   // Convert the s-digits to normal digits
     232           0 :   digitizer.SDigits2Digits();
     233             : 
     234             :   // Store the digits
     235           0 :   if (!fLoader->TreeD()) {
     236           0 :     fLoader->MakeTree("D");
     237             :   }
     238           0 :   if (digitizer.MakeBranch(fLoader->TreeD())){
     239           0 :     digitizer.WriteDigits();
     240             :   }
     241             : 
     242           0 : }
     243             : 
     244             : //_____________________________________________________________________________
     245             : void AliTRD::Digits2Raw() 
     246             : {
     247             :   //
     248             :   // Convert digits of the current event to raw data
     249             :   //
     250             : 
     251           8 :   fLoader->LoadDigits();
     252           4 :   TTree *digits = fLoader->TreeD();
     253           4 :   if (!digits) {
     254           0 :     AliError("No digits tree");
     255           0 :     return;
     256             :   }
     257             : 
     258           4 :   AliTRDrawData rawWriter;
     259           8 :   if (!rawWriter.Digits2Raw(digits)) {
     260           0 :     AliError("The raw writer could not load the digits tree");
     261             :   }
     262             : 
     263           4 :   fLoader->UnloadDigits();
     264             : 
     265           8 : }
     266             : 
     267             : //_____________________________________________________________________________
     268             : void AliTRD::AddHit(Int_t track, Int_t det, Float_t *hits, Int_t q
     269             :                   , Float_t time, Bool_t inDrift)
     270             : {
     271             :   //
     272             :   // Add a hit for the TRD
     273             :   // 
     274             : 
     275       23225 :   TClonesArray &lhits = *fHits;
     276       23225 :   AliTRDhit *hit = new(lhits[fNhits++]) AliTRDhit(fIshunt
     277             :                                                  ,track
     278             :                                                  ,det
     279             :                                                  ,hits
     280             :                                                  ,q
     281             :                                                  ,time);
     282             : 
     283       23225 :   if (inDrift) {
     284       18541 :     hit->SetDrift();
     285       18541 :   }
     286             :   else {
     287        4684 :     hit->SetAmplification();
     288             :   }
     289             : 
     290       23225 :   if (q < 0) {
     291          19 :     hit->SetTRphoton();
     292          19 :   }
     293             : 
     294       23225 : }
     295             :  
     296             : //_____________________________________________________________________________
     297             : void AliTRD::CreateGeometry()
     298             : {
     299             :   //
     300             :   // Creates the volumes for the TRD chambers
     301             :   //
     302             : 
     303             :   // Check that FRAME is there otherwise we have no place where to put the TRD
     304           2 :   AliModule *frame = gAlice->GetModule("FRAME");
     305           1 :   if (!frame) {
     306           0 :     AliFatal("The TRD needs the FRAME to be defined first");
     307           0 :   }
     308             : 
     309           1 :   fGeometry->CreateGeometry(fIdtmed->GetArray() - 1299);
     310             : 
     311           1 : }
     312             : 
     313             : //_____________________________________________________________________________
     314             : void AliTRD::CreateMaterials()
     315             : {
     316             :   //
     317             :   // Create the materials for the TRD
     318             :   //
     319             : 
     320           2 :   Int_t   isxfld = ((AliMagF *) TGeoGlobalMagField::Instance()->GetField())->Integ();
     321           1 :   Float_t sxmgmx = ((AliMagF *) TGeoGlobalMagField::Instance()->GetField())->Max();
     322             :   
     323             :   //////////////////////////////////////////////////////////////////////////
     324             :   //     Define Materials 
     325             :   //////////////////////////////////////////////////////////////////////////
     326             : 
     327             :   // Aluminum
     328           1 :   AliMaterial( 1,"Al",  26.98, 13.0, 2.7,    8.9,  37.2);
     329             :   // Copper
     330           1 :   AliMaterial( 2,"Cu",  63.54, 29.0, 8.96,   1.43, 14.8);
     331             :   // Carbon
     332           1 :   AliMaterial( 3,"C" ,  12.01,  6.0, 2.265, 18.8,  74.4);
     333             :   // Carbon for fiber mats
     334           1 :   AliMaterial( 4,"C2",  12.01,  6.0, 1.75,  18.8,  74.4);
     335             :   // Zinc
     336           1 :   AliMaterial( 5,"Sn", 118.71, 50.0, 7.31,   1.21, 14.8);
     337             :   // Silicon
     338           1 :   AliMaterial( 6,"Si",  28.09, 14.0, 2.33,   9.36, 37.2);
     339             :   // Iron
     340           1 :   AliMaterial( 7,"Fe",  55.85, 26.0, 7.87,   1.76, 14.8);
     341             : 
     342             :   // Air  
     343           1 :   Float_t aAir[4]   = { 12.011   , 14.0     , 15.9994  , 36.0      };
     344           1 :   Float_t zAir[4]   = {  6.0     ,  7.0     ,  8.0     , 18.0      };
     345           1 :   Float_t wAir[4]   = {  0.000124,  0.755267,  0.231781,  0.012827 };
     346             :   Float_t dAir      = 1.20479e-03;
     347           1 :   AliMixture(51,"Air",          aAir,   zAir,   dAir,    4, wAir  );
     348             :   // Polyethilene (CH2) 
     349           1 :   Float_t ape[2]    = { 12.011 ,  1.0079 };
     350           1 :   Float_t zpe[2]    = {  6.0   ,  1.0    };
     351           1 :   Float_t wpe[2]    = {  1.0   ,  2.0    };
     352             :   Float_t dpe       = 0.95;
     353           1 :   AliMixture(52,"Polyethilene", ape,    zpe,    dpe,    -2, wpe   );
     354             :   // Gas mixtures
     355             :   // Xe/CO2-gas-mixture (85% / 15%) 
     356           1 :   Float_t aXeCO2[3] = { 131.29   ,  12.0107 ,  15.9994  };
     357           1 :   Float_t zXeCO2[3] = {  54.0    ,   6.0    ,   8.0     };
     358           1 :   Float_t wXeCO2[3] = {   8.5    ,   1.5    ,   3.0     }; 
     359             :   Float_t fxc       = 0.85;
     360             :   Float_t dxe       = 0.00549; // at 20C
     361             :   Float_t dco       = 0.00186; // at 20C
     362             :   Float_t dgmXe     = fxc * dxe + (1.0 - fxc) * dco;
     363             :   // Ar/CO2-gas-mixture
     364           1 :   Float_t aArCO2[3] = {  39.948  ,  12.0107 ,  15.9994  };
     365           1 :   Float_t zArCO2[3] = {  18.0    ,   6.0    ,   8.0     };
     366           1 :   Float_t wArCO2[3] = {   8.2    ,   1.8    ,   3.6     }; 
     367             :   Float_t fac       = 0.82;
     368             :   Float_t dar       = 0.00166; // at 20C
     369             :   Float_t dgmAr     = fac * dar + (1.0 - fac) * dco;
     370           1 :   if      (AliTRDCommonParam::Instance()->IsXenon()) {
     371           1 :     AliMixture(53,"XeCO2",        aXeCO2, zXeCO2, dgmXe,  -3, wXeCO2);
     372           1 :   }
     373           0 :   else if (AliTRDCommonParam::Instance()->IsArgon()) {
     374           0 :     AliInfo("Gas mixture: Ar C02 (80/20)");
     375           0 :     AliMixture(53,"ArCO2",        aArCO2, zArCO2, dgmAr,  -3, wArCO2);
     376             :   }
     377             :   else {
     378           0 :     AliFatal("Wrong gas mixture");
     379           0 :     exit(1);
     380             :   }
     381             :   // G10
     382           1 :   Float_t aG10[4]   = {  1.0079, 12.011 , 15.9994, 28.086  };
     383           1 :   Float_t zG10[4]   = {  1.0   ,  6.0   ,  8.0   , 14.0    };
     384           1 :   Float_t wG10[4]   = {  0.023 ,  0.194 ,  0.443 ,  0.340  };
     385             :   Float_t dG10      = 2.0;
     386           1 :   AliMixture(54,"G10",          aG10,  zG10,  dG10,   4,wG10  );
     387             :   // Water
     388           1 :   Float_t awa[2]    = {  1.0079, 15.9994 };
     389           1 :   Float_t zwa[2]    = {  1.0   ,  8.0    };
     390           1 :   Float_t wwa[2]    = {  2.0   ,  1.0    };
     391             :   Float_t dwa       = 1.0;
     392           1 :   AliMixture(55,"Water",        awa,   zwa,   dwa,   -2,wwa   );
     393             :   // Rohacell (C5H8O2), X0 = 535.005cm
     394           1 :   Float_t arh[3]    = { 12.011 ,  1.0079, 15.9994 };
     395           1 :   Float_t zrh[3]    = {  6.0   ,  1.0   ,  8.0    };
     396           1 :   Float_t wrh[3]    = {  5.0   ,  8.0   ,  2.0    };
     397             :   Float_t drh       = 0.075;   
     398           1 :   AliMixture(56,"Rohacell",     arh,   zrh,   drh,   -3,wrh   );
     399             :   // Epoxy (C18H19O3)
     400           1 :   Float_t aEpoxy[3] = { 15.9994,  1.0079, 12.011  }; 
     401           1 :   Float_t zEpoxy[3] = {  8.0   ,  1.0   ,  6.0    }; 
     402           1 :   Float_t wEpoxy[3] = {  3.0   , 19.0   , 18.0    }; 
     403             :   Float_t dEpoxy    = 1.8 ; 
     404           1 :   AliMixture(57,"Epoxy",        aEpoxy,zEpoxy,dEpoxy,-3,wEpoxy);
     405             :   // Araldite, low density epoxy (C18H19O3)
     406           1 :   Float_t aAral[3]  = { 15.9994,  1.0079, 12.011  }; 
     407           1 :   Float_t zAral[3]  = {  8.0   ,  1.0   ,  6.0    }; 
     408           1 :   Float_t wAral[3]  = {  3.0   , 19.0   , 18.0    }; 
     409             :   Float_t dAral     = 1.12; // Hardener: 1.15, epoxy: 1.1, mixture: 1/2
     410           1 :   AliMixture(58,"Araldite",     aAral, zAral, dAral, -3,wAral );
     411             :   // Mylar
     412           1 :   Float_t aMy[3]    = { 12.011 ,   1.0  , 15.9994 };
     413           1 :   Float_t zMy[3]    = {  6.0   ,   1.0  ,  8.0    };
     414           1 :   Float_t wMy[3]    = {  5.0   ,   4.0  ,  2.0    };
     415             :   Float_t dMy       = 1.39;
     416           1 :   AliMixture(59,"Mylar",        aMy,   zMy,   dMy,   -3,wMy   );
     417             :   // Polypropylene (C3H6) for radiator fibers
     418           1 :   Float_t app[2]    = { 12.011 ,  1.0079 };
     419           1 :   Float_t zpp[2]    = {  6.0   ,  1.0    };
     420           1 :   Float_t wpp[2]    = {  3.0   ,  6.0    };
     421             :   Float_t dpp       = 0.068;
     422           1 :   AliMixture(60,"Polypropylene",app,   zpp,   dpp,   -2,wpp   );
     423             :   // Aramide for honeycomb
     424           1 :   Float_t aAra[4]   = {  1.0079, 12.011 , 15.9994, 14.0067 };
     425           1 :   Float_t zAra[4]   = {  1.0   ,  6.0   ,  8.0   ,  7.0    };
     426           1 :   Float_t wAra[4]   = {  3.0   ,  1.0   ,  1.0   ,  1.0    };
     427             :   Float_t dAra      = 0.032;
     428           1 :   AliMixture(61,"Aramide",      aAra,  zAra,  dAra,  -4,wAra  );
     429             :   // GFK for Wacosit (Epoxy + Si)
     430           1 :   Float_t aGFK[4]   = {  1.0079, 12.011 , 15.9994, 28.086  };
     431           1 :   Float_t zGFK[4]   = {  1.0   ,  6.0   ,  8.0   , 14.0    };
     432           1 :   Float_t wGFK[4]   = {  0.0445,  0.5031,  0.1118,  0.340  };
     433             :   Float_t dGFK      = 2.0;
     434           1 :   AliMixture(62,"GFK",          aGFK,  zGFK,  dGFK,   4,wGFK  );
     435             : 
     436             :   //////////////////////////////////////////////////////////////////////////
     437             :   //     Tracking Media Parameters 
     438             :   //////////////////////////////////////////////////////////////////////////
     439             : 
     440             :   // General tracking parameter
     441             :   Float_t tmaxfd    = -10.0;
     442             :   Float_t stemax    = -1.0e10;
     443             :   Float_t deemax    = -0.1;
     444             :   Float_t epsil     =  1.0e-4;
     445             :   Float_t stmin     = -0.001;
     446             : 
     447             :   // Al Frame 
     448           1 :   AliMedium( 1,"Al Frame"   , 1,0,isxfld,sxmgmx
     449             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     450             :   // Air 
     451           1 :   AliMedium( 2,"Air"        ,51,0,isxfld,sxmgmx
     452             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     453             :   // Wires
     454           1 :   AliMedium( 3,"Wires"      , 2,0,isxfld,sxmgmx
     455             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     456             :   // All other ROB materials (caps, etc.)
     457           1 :   AliMedium( 4,"ROB Other"  , 2,0,isxfld,sxmgmx
     458             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     459             :   // Cu pads 
     460           1 :   AliMedium( 5,"Padplane"   , 2,1,isxfld,sxmgmx
     461             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     462             :   // Fee + cables 
     463           1 :   AliMedium( 6,"Readout"    , 2,0,isxfld,sxmgmx
     464             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     465             :   // C frame (Wacosit) 
     466           1 :   AliMedium( 7,"Wacosit"    ,62,0,isxfld,sxmgmx
     467             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     468             :   // INOX of cooling bus bars
     469           1 :   AliMedium( 8,"Cooling bus", 7,0,isxfld,sxmgmx
     470             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     471             :   // Gas-mixture (Xe/CO2) 
     472           1 :   AliMedium( 9,"Gas-mix"    ,53,1,isxfld,sxmgmx
     473             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     474             :   // Honeycomb
     475           1 :   AliMedium(10,"Honeycomb"  ,61,0,isxfld,sxmgmx
     476             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     477             :   // Araldite glue
     478           1 :   AliMedium(11,"Glue"       ,58,0,isxfld,sxmgmx
     479             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     480             :   // G10-plates
     481           1 :   AliMedium(13,"G10-plates" ,54,0,isxfld,sxmgmx
     482             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     483             :   // Cooling water
     484           1 :   AliMedium(14,"Water"      ,55,0,isxfld,sxmgmx
     485             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     486             :   // Rohacell for the radiator
     487           1 :   AliMedium(15,"Rohacell"   ,56,0,isxfld,sxmgmx
     488             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     489             :   // Al layer in MCMs
     490           1 :   AliMedium(16,"MCM-Al"     , 1,0,isxfld,sxmgmx
     491             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     492             :   // Sn layer in MCMs
     493           1 :   AliMedium(17,"MCM-Sn"     , 5,0,isxfld,sxmgmx
     494             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     495             :   // Cu layer in MCMs
     496           1 :   AliMedium(18,"MCM-Cu"     , 2,0,isxfld,sxmgmx
     497             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     498             :   // G10 layer in MCMs
     499           1 :   AliMedium(19,"MCM-G10"    ,54,0,isxfld,sxmgmx
     500             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     501             :   // Si in readout chips
     502           1 :   AliMedium(20,"Chip-Si"    , 6,0,isxfld,sxmgmx
     503             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     504             :   // Epoxy in readout chips
     505           1 :   AliMedium(21,"Chip-Ep"    ,57,0,isxfld,sxmgmx
     506             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     507             :   // PE in connectors
     508           1 :   AliMedium(22,"Conn-PE"    ,52,0,isxfld,sxmgmx
     509             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     510             :   // Cu in connectors
     511           1 :   AliMedium(23,"Chip-Cu"    , 2,0,isxfld,sxmgmx
     512             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     513             :   // Al of cooling pipes
     514           1 :   AliMedium(24,"Cooling"    , 1,0,isxfld,sxmgmx
     515             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     516             :   // Cu in services
     517           1 :   AliMedium(25,"Serv-Cu"    , 2,0,isxfld,sxmgmx
     518             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     519             :   // Carbon fiber mat
     520           1 :   AliMedium(26,"Carbon"     , 4,0,isxfld,sxmgmx
     521             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     522             :   // Mylar foil
     523           1 :   AliMedium(27,"Mylar"      ,59,0,isxfld,sxmgmx
     524             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     525             :   // Polypropylene fibers
     526           1 :   AliMedium(28,"Fiber"      ,60,0,isxfld,sxmgmx
     527             :               ,tmaxfd,stemax,deemax,epsil,stmin);
     528             : 
     529             :   // Save the density values for the TRD absorbtion
     530             :   Float_t dmy  = 1.39;
     531           1 :   fFoilDensity = dmy;
     532           1 :   if      (AliTRDCommonParam::Instance()->IsXenon()) {
     533           1 :     fGasDensity       = dgmXe;
     534           1 :     fGasNobleFraction = fxc;
     535           1 :   }
     536           0 :   else if (AliTRDCommonParam::Instance()->IsArgon()) {
     537           0 :     fGasDensity       = dgmAr;
     538           0 :     fGasNobleFraction = fac;
     539           0 :   }
     540             : 
     541           1 : }
     542             :  
     543             : //_____________________________________________________________________________
     544             : void AliTRD::Init()
     545             : {
     546             :   //
     547             :   // Initialize the TRD detector after the geometry has been created
     548             :   //
     549             : 
     550           4 :   AliDebug(1,"++++++++++++++++++++++++++++++++++++++++++++++");
     551             : 
     552           1 :   if (fGeometry->IsVersion() != 1) {
     553           0 :     AliError("Not a valid geometry");
     554           0 :   }
     555             : 
     556           1 : }
     557             : 
     558             : //_____________________________________________________________________________
     559             : void AliTRD::ResetDigits()
     560             : {
     561             :   //
     562             :   // Reset number of digits and the digits array for this detector
     563             :   //
     564             : 
     565           0 :   fNdigits = 0;
     566             : 
     567           0 :   if (fDigits) {
     568           0 :     fDigits->Clear();
     569           0 :   }
     570             : 
     571           0 : }
     572             : 
     573             : //_____________________________________________________________________________
     574             : void AliTRD::SetTreeAddress()
     575             : {
     576             :   //
     577             :   // Set the branch addresses for the trees.
     578             :   //
     579             : 
     580         346 :   if (fLoader->TreeH() && 
     581          34 :       (fHits == 0x0)) {
     582           4 :     fHits = new TClonesArray("AliTRDhit",405);
     583           2 :   }
     584         156 :   AliDetector::SetTreeAddress();
     585             : 
     586         156 : }
     587             : 
     588             : //_____________________________________________________________________________
     589             : Bool_t AliTRD::Raw2SDigits(AliRawReader *rawReader)
     590             : {
     591             :   //
     592             :   // Converts RAW data to SDigits
     593             :   //
     594             : 
     595           0 :   AliLoader *loader = fRunLoader->GetLoader("TRDLoader");
     596           0 :   if (!loader) {
     597           0 :     AliError("Can not get TRD loader from Run Loader");
     598           0 :     return kFALSE;
     599             :   }
     600             :     
     601             :   TTree *tree = 0;
     602           0 :   tree = loader->TreeS();
     603           0 :   if (!tree) {
     604           0 :     loader->MakeTree("S");
     605           0 :     tree = loader->TreeS();
     606           0 :   }
     607             : 
     608           0 :   AliTRDdigitizer digitizer("TRDdigitizer","TRD digitizer class");  
     609             : 
     610           0 :   AliTRDrawData       *rawdata        = new AliTRDrawData();
     611           0 :   AliTRDdigitsManager *digitsManager  = rawdata->Raw2Digits(rawReader);
     612             : 
     613             :   // Create the s-digits manager
     614           0 :   AliTRDdigitsManager *sdigitsManager = new AliTRDdigitsManager();
     615             : 
     616           0 :   if (sdigitsManager) {
     617             : 
     618           0 :     sdigitsManager->SetSDigits(kTRUE);
     619           0 :     sdigitsManager->CreateArrays();
     620             : 
     621             :     // Convert the digits into s-digits
     622           0 :     digitizer.Digits2SDigits(digitsManager,sdigitsManager);
     623             : 
     624           0 :     sdigitsManager->MakeBranch(tree);
     625           0 :     sdigitsManager->WriteDigits();
     626             : 
     627           0 :     delete digitsManager;
     628             : 
     629           0 :     return kTRUE;
     630             : 
     631             :   } 
     632             :   else {
     633             : 
     634           0 :     return kFALSE;
     635             : 
     636             :   }
     637             : 
     638           0 : }
     639             : 
     640             : //_____________________________________________________________________________
     641             : AliLoader *AliTRD::MakeLoader(const Char_t *topfoldername)
     642             : {
     643             :   //
     644             :   // Create a loader for the TRD tracklets
     645             :   //
     646             : 
     647           4 :  fLoader = new AliLoader(GetName(),topfoldername);
     648             : 
     649           1 :  AliInfo("Adding Tracklets-loader");
     650             : 
     651           1 :  AliDataLoader *dl = new AliDataLoader("TRD.Tracklets.root"
     652             :                                       ,"tracklets"
     653             :                                       ,"tracklets");
     654           1 :  fLoader->AddDataLoader(dl);
     655             : 
     656           1 :                 dl = new AliDataLoader("TRD.GtuTracks.root"
     657             :                                       ,"gtutracks"
     658             :                                       ,"gtutracks");
     659           1 :  fLoader->AddDataLoader(dl);
     660             : 
     661           1 :  return fLoader;
     662             : 
     663           0 : }
     664             : 
     665             : //_____________________________________________________________________________
     666             : AliTRD &AliTRD::operator=(const AliTRD &trd)
     667             : {
     668             :   //
     669             :   // Assignment operator
     670             :   //
     671             : 
     672           0 :   if (this != &trd) {
     673           0 :     ((AliTRD &) trd).Copy(*this);
     674           0 :   }
     675             : 
     676           0 :   return *this;
     677             : 
     678             : }

Generated by: LCOV version 1.11