* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
- $Log$
- Revision 1.65 2003/01/14 10:50:19 alibrary
- Cleanup of STEER coding conventions
-
- Revision 1.64 2002/11/21 22:54:07 alibrary
- Removing AliMC and AliMCProcess
-
- Revision 1.63 2002/11/04 09:02:52 morsch
- Further corrcetions on Fresnel and Grid losses.
-
- Revision 1.62 2002/10/31 08:44:04 morsch
- Problems with rotated RICH solved:
- Detector response (fresnel reflection, grid absorption ...) has to be
- determined using local coordinates.
-
- Revision 1.61 2002/10/29 15:00:08 morsch
- - Diagnostics updated.
- - RecHits structure synchronized.
- - Digitizer method using AliRICHDigitizer.
- (J. Barbosa)
-
-
- Revision 1.60 2002/10/22 16:28:21 alibrary
- Introducing Riostream.h
-
- Revision 1.59 2002/10/14 14:57:31 hristov
- Merging the VirtualMC branch to the main development branch (HEAD)
-
- Revision 1.58.6.1 2002/06/10 15:12:46 hristov
- Merged with v3-08-02
-
- Revision 1.58 2001/11/14 09:49:37 dibari
- Use debug methods
-
- Revision 1.57 2001/11/09 17:29:31 dibari
- Setters fro models moved to header
-
- Revision 1.56 2001/11/02 15:37:25 hristov
- Digitizer class created. Code cleaning and bug fixes (J.Chudoba)
-
- Revision 1.55 2001/10/23 13:03:35 hristov
- The access to several data members was changed from public to protected. The digitisation was adapted to the multi-event case (J.Chudoba)
-
- Revision 1.54 2001/09/07 08:38:10 hristov
- Pointers initialised to 0 in the default constructors
-
- Revision 1.53 2001/08/30 09:51:23 hristov
- The operator[] is replaced by At() or AddAt() in case of TObjArray.
-
- Revision 1.52 2001/05/16 14:57:20 alibrary
- New files for folders and Stack
-
- Revision 1.51 2001/05/14 10:18:55 hristov
- Default arguments declared once
-
- Revision 1.50 2001/05/10 14:44:16 jbarbosa
- Corrected some overlaps (thanks I. Hrivnacovna).
-
- Revision 1.49 2001/05/10 12:23:49 jbarbosa
- Repositioned the RICH modules.
- Eliminated magic numbers.
- Incorporated diagnostics (from macros).
-
- Revision 1.48 2001/03/15 10:35:00 jbarbosa
- Corrected bug in MakeBranch (was using a different version of STEER)
-
- Revision 1.47 2001/03/14 18:13:56 jbarbosa
- Several changes to adapt to new IO.
- Removed digitising function, using AliRICHMerger::Digitise from now on.
-
- Revision 1.46 2001/03/12 17:46:33 hristov
- Changes needed on Sun with CC 5.0
-
- Revision 1.45 2001/02/27 22:11:46 jbarbosa
- Testing TreeS, removing of output.
-
- Revision 1.44 2001/02/27 15:19:12 jbarbosa
- Transition to SDigits.
-
- Revision 1.43 2001/02/23 17:19:06 jbarbosa
- Corrected photocathode definition in BuildGeometry().
-
- Revision 1.42 2001/02/13 20:07:23 jbarbosa
- Parametrised definition of photcathode dimensions. New spacers. New data members in AliRICHHit to store particle momentum
- when entering the freon. Corrected calls to particle stack.
-
- Revision 1.41 2001/01/26 20:00:20 hristov
- Major upgrade of AliRoot code
-
- Revision 1.40 2001/01/24 20:58:03 jbarbosa
- Enhanced BuildGeometry. Now the photocathodes are drawn.
-
- Revision 1.39 2001/01/22 21:40:24 jbarbosa
- Removing magic numbers
-
- Revision 1.37 2000/12/20 14:07:25 jbarbosa
- Removed dependencies on TGeant3 (thanks to F. Carminati and I. Hrivnacova)
-
- Revision 1.36 2000/12/18 17:45:54 jbarbosa
- Cleaned up PadHits object.
-
- Revision 1.35 2000/12/15 16:49:40 jbarbosa
- Geometry and materials updates (wire supports, pcbs, backplane supports, frame).
-
- Revision 1.34 2000/11/10 18:12:12 jbarbosa
- Bug fix for AliRICHCerenkov (thanks to P. Hristov)
-
- Revision 1.33 2000/11/02 10:09:01 jbarbosa
- Minor bug correction (some pointers were not initialised in the default constructor)
-
- Revision 1.32 2000/11/01 15:32:55 jbarbosa
- Updated to handle both reconstruction algorithms.
-
- Revision 1.31 2000/10/26 20:18:33 jbarbosa
- Supports for methane and freon vessels
-
- Revision 1.30 2000/10/24 13:19:12 jbarbosa
- Geometry updates.
-
- Revision 1.29 2000/10/19 19:39:25 jbarbosa
- Some more changes to geometry. Further correction of digitisation "per part. type"
-
- Revision 1.28 2000/10/17 20:50:57 jbarbosa
- Inversed digtise by particle type (now, only the selected particle type is not digitsed).
- Corrected several geometry minor bugs.
- Added new parameter (opaque quartz thickness).
-
- Revision 1.27 2000/10/11 10:33:55 jbarbosa
- Corrected bug introduced by earlier revisions (CerenkovData array cannot be reset to zero on wach call of StepManager)
-
- Revision 1.26 2000/10/03 21:44:08 morsch
- Use AliSegmentation and AliHit abstract base classes.
-
- Revision 1.25 2000/10/02 21:28:12 fca
- Removal of useless dependecies via forward declarations
-
- Revision 1.24 2000/10/02 15:43:17 jbarbosa
- Fixed forward declarations.
- Fixed honeycomb density.
- Fixed cerenkov storing.
- New electronics.
-
- Revision 1.23 2000/09/13 10:42:14 hristov
- Minor corrections for HP, DEC and Sun; strings.h included
-
- Revision 1.22 2000/09/12 18:11:13 fca
- zero hits area before using
-
- Revision 1.21 2000/07/21 10:21:07 morsch
- fNrawch = 0; and fNrechits = 0; in the default constructor.
-
- Revision 1.20 2000/07/10 15:28:39 fca
- Correction of the inheritance scheme
-
- Revision 1.19 2000/06/30 16:29:51 dibari
- Added kDebugLevel variable to control output size on demand
-
- Revision 1.18 2000/06/12 15:15:46 jbarbosa
- Cleaned up version.
-
- Revision 1.17 2000/06/09 14:58:37 jbarbosa
- New digitisation per particle type
-
- Revision 1.16 2000/04/19 12:55:43 morsch
- Newly structured and updated version (JB, AM)
-
-*/
-
+/* $Id$ */
////////////////////////////////////////////////
// Manager and hits classes for set:RICH //
////////////////////////////////////////////////
+#include <Riostream.h>
#include <strings.h>
-#include <Riostream.h>
#include <TArrayF.h>
#include <TBRIK.h>
#include <TCanvas.h>
#include <TTUBE.h>
#include <TTree.h>
#include <TVector.h>
-
#include "AliConst.h"
#include "AliMagF.h"
#include "AliPoints.h"
#include "AliRICH.h"
-#include "AliRICHCerenkov.h"
#include "AliRICHClusterFinder.h"
#include "AliRICHDigit.h"
#include "AliRICHDigitizer.h"
-#include "AliRICHHit.h"
#include "AliRICHHitMapA1.h"
#include "AliRICHMerger.h"
#include "AliRICHRawCluster.h"
#include "AliRun.h"
#include "AliRunDigitizer.h"
#include "AliSegmentation.h"
-
-
-
+#include "AliRICHParam.h"
static Int_t sMaxIterPad=0; // Static variables for the pad-hit iterator routines
static Int_t sCurIterPad=0;
+ClassImp(AliRICHhit)
+ClassImp(AliRICHdigit)
ClassImp(AliRICH)
//___________________________________________
//End_Html
AliRICH::AliRICH()
-{
-// Default ctor should not contain any new operators
-
- fIshunt = 0;
- fHits = 0;
- fSDigits = 0;
- fNSDigits = 0;
- fNcerenkovs = 0;
- fDchambers = 0;
- fRecHits1D = 0;
- fRecHits3D = 0;
- fRawClusters = 0;
- fChambers = 0;
- fCerenkovs = 0;
- for (Int_t i=0; i<7; i++){
- fNdch[i] = 0;
- fNrawch[i] = 0;
- fNrechits1D[i] = 0;
- fNrechits3D[i] = 0;
- }
-
- fFileName = 0;
- fMerger = 0;
+{//Default ctor should not contain any new operators
+ fIshunt = 0;
+ fHits = 0;
+ fSDigits = 0;
+ fNsdigits = 0;
+ fNcerenkovs = 0;
+ fDchambers = 0;
+ fRecHits1D = 0;
+ fRecHits3D = 0;
+ fRawClusters = 0;
+ fChambers = 0;
+ fCerenkovs = 0;
+ for (Int_t i=0; i<kNCH; i++){
+ fNdch[i] = 0;
+ fNrawch[i] = 0;
+ fNrechits1D[i] = 0;
+ fNrechits3D[i] = 0;
+ }
+ fpParam=0;
+//kir fFileName = 0;
+//kir fMerger = 0;
}//AliRICH::AliRICH()
-
+//______________________________________________________________________________
AliRICH::AliRICH(const char *name, const char *title)
- : AliDetector(name,title)
-{
-// Named ctor
- cout<<ClassName()<<"::named ctor(sName,sTitle)>\n"; // no way to control it as ctor is called before call to SetDebugXXXX()
-
- fHits = new TClonesArray("AliRICHHit",1000 );
- gAlice->AddHitList(fHits);
- fSDigits = new TClonesArray("AliRICHSDigit",100000);
- fCerenkovs = new TClonesArray("AliRICHCerenkov",1000);
- gAlice->AddHitList(fCerenkovs);
- fNSDigits = 0;
- fNcerenkovs = 0;
- fIshunt = 0;
-
- //fNdch = new Int_t[kNCH];
-
- fDchambers = new TObjArray(kNCH);
-
- fRecHits1D = new TObjArray(kNCH);
- fRecHits3D = new TObjArray(kNCH);
-
- Int_t i;
-
- for (i=0; i<kNCH ;i++) {
- //PH (*fDchambers)[i] = new TClonesArray("AliRICHDigit",10000);
- fDchambers->AddAt(new TClonesArray("AliRICHDigit",10000), i);
- fNdch[i]=0;
- }
-
- //fNrawch = new Int_t[kNCH];
-
- fRawClusters = new TObjArray(kNCH);
- //printf("Created fRwClusters with adress:%p",fRawClusters);
-
- for (i=0; i<kNCH ;i++) {
- //PH (*fRawClusters)[i] = new TClonesArray("AliRICHRawCluster",10000);
- fRawClusters->AddAt(new TClonesArray("AliRICHRawCluster",10000), i);
- fNrawch[i]=0;
- }
-
- //fNrechits = new Int_t[kNCH];
-
- for (i=0; i<kNCH ;i++) {
- //PH (*fRecHits1D)[i] = new TClonesArray("AliRICHRecHit1D",1000);
- fRecHits1D->AddAt(new TClonesArray("AliRICHRecHit1D",1000), i);
- }
- for (i=0; i<kNCH ;i++) {
- //PH (*fRecHits3D)[i] = new TClonesArray("AliRICHRecHit3D",1000);
- fRecHits3D->AddAt(new TClonesArray("AliRICHRecHit3D",1000), i);
- }
- //printf("Created fRecHits with adress:%p",fRecHits);
-
-
- SetMarkerColor(kRed);
-
- /*fChambers = new TObjArray(kNCH);
- for (i=0; i<kNCH; i++)
- (*fChambers)[i] = new AliRICHChamber();*/
-
- fFileName = 0;
- fMerger = 0;
-}
-
-AliRICH::AliRICH(const AliRICH& RICH)
-{
-// Copy ctor
-}
-
-
+ :AliDetector(name,title)
+{//Named ctor
+ if(GetDebug())Info("named ctor","Start.");
+ fpParam =new AliRICHParam;
+ fHits =new TClonesArray("AliRICHhit",1000 );
+ fCerenkovs =new TClonesArray("AliRICHCerenkov",1000);
+ fSDigits =new TClonesArray("AliRICHdigit",100000);
+ gAlice->AddHitList(fHits);
+ gAlice->AddHitList(fCerenkovs);
+ fNsdigits =0;
+ fNcerenkovs =0;
+ fIshunt =0;
+ fDchambers =new TObjArray(kNCH);
+ fRawClusters=new TObjArray(kNCH);
+ fRecHits1D =new TObjArray(kNCH);
+ fRecHits3D =new TObjArray(kNCH);
+ for(int i=0;i<kNCH;i++) {
+ fDchambers->AddAt(new TClonesArray("AliRICHDigit",10000), i);
+ fRawClusters->AddAt(new TClonesArray("AliRICHRawCluster",10000), i);
+ fRecHits1D->AddAt(new TClonesArray("AliRICHRecHit1D",1000), i);
+ fRecHits3D->AddAt(new TClonesArray("AliRICHRecHit3D",1000), i);
+ fNdch[i]=0;
+ fNrawch[i]=0;
+ }
+ SetMarkerColor(kRed);
+ fCkovNumber=fFreonProd=0;
+//kir fFileName = 0;
+//kir fMerger = 0;
+ if(GetDebug())Info("named ctor","Stop.");
+}//AliRICH::AliRICH(const char *name, const char *title)
+//______________________________________________________________________________
AliRICH::~AliRICH()
-{
-// Dtor of RICH manager class
- if(IsDebugStart()) cout<<ClassName()<<"::default dtor()>\n";
+{//dtor
+ if(GetDebug()) Info("dtor","Start.");
fIshunt = 0;
delete fHits;
fRecHits3D->Delete();
delete fRecHits3D;
}
-
-}
-
-
-//_____________________________________________________________________________
+ if(GetDebug()) Info("dtor","Stop.");
+}//AliRICH::~AliRICH()
+//______________________________________________________________________________
Int_t AliRICH::Hits2SDigits(Float_t xhit,Float_t yhit,Float_t eloss, Int_t idvol, ResponseType res)
-{
-// Calls the charge disintegration method of the current chamber and adds
-// the simulated cluster to the root tree
- if(IsDebugHit()||IsDebugDigit()) cout<<ClassName()<<"::Hits2SDigits(...)>\n";
+{//calls the charge disintegration method of the current chamber and adds all generated sdigits to the list of digits
- Int_t clhits[5];
- Float_t newclust[4][500];
- Int_t nnew;
-
-//
-// Integrated pulse height on chamber
-
- clhits[0]=fNhits+1;
+ Int_t iChamber,iPadX,iPadY,iAdc,iTrack;
+ Float_t list[4][500];
+ Int_t iNdigits;
+
- ((AliRICHChamber*)fChambers->At(idvol))->DisIntegration(eloss, xhit, yhit, nnew, newclust, res);
+ ((AliRICHChamber*)fChambers->At(idvol))->DisIntegration(eloss, xhit, yhit, iNdigits, list, res);
Int_t ic=0;
-//
-// Add new clusters
- for (Int_t i=0; i<nnew; i++) {
- if (Int_t(newclust[0][i]) > 0) {
+ for(Int_t i=0; i<iNdigits; i++) {
+ if(Int_t(list[0][i]) > 0) {
ic++;
-// Cluster Charge
- clhits[1] = Int_t(newclust[0][i]);
-// Pad: ix
- clhits[2] = Int_t(newclust[1][i]);
-// Pad: iy
- clhits[3] = Int_t(newclust[2][i]);
-// Pad: chamber sector
- clhits[4] = Int_t(newclust[3][i]);
-
- //printf(" %d %d %d %d %d\n", clhits[0], clhits[1], clhits[2], clhits[3], clhits[4]);
+ iAdc = Int_t(list[0][i]);
+ iPadX = Int_t(list[1][i]);
+ iPadY = Int_t(list[2][i]);
+ iChamber = Int_t(list[3][i]);
+
- AddSDigit(clhits);
+ AddSDigit(iChamber,iPadX,iPadY,iAdc,iTrack);
}
}
- if (gAlice->TreeS()){
+ if(gAlice->TreeS()){
gAlice->TreeS()->Fill();
gAlice->TreeS()->Write(0,TObject::kOverwrite);
- //printf("Filled SDigits...\n");
}
-
- return nnew;
+ return iNdigits;
}//Int_t AliRICH::Hits2SDigits(Float_t xhit,Float_t yhit,Float_t eloss, Int_t idvol, ResponseType res)
-
+//______________________________________________________________________________
void AliRICH::Hits2SDigits()
-{
-// Dummy: sdigits are created during transport.
-// Called from alirun.
- if(IsDebugHit()||IsDebugDigit()) cout<<ClassName()<<"::Hits2SDigits()>\n";
-
-
- int nparticles = gAlice->GetNtrack();
- cout << "Particles (RICH):" <<nparticles<<endl;
- if (nparticles > 0) printf("SDigits were already generated.\n");
-
+{//Create a list of sdigits corresponding to list of hits. Every hit generates sdigit.
+ if(GetDebug()) Info("Hit2SDigits","Start.");
+
+ for(Int_t iEventN=0;iEventN<gAlice->GetEventsPerRun();iEventN++){//loop on events
+ fLoader->GetRunLoader()->GetEvent(iEventN);
+
+ if(!fLoader->TreeH()) fLoader->LoadHits();
+ if(!fLoader->TreeS()) fLoader->MakeTree("S");
+ MakeBranch("S");
+
+ for(int iPrimN=0;iPrimN<TreeH()->GetEntries();iPrimN++){//loop on primary tracks
+ fLoader->TreeH()->GetEntry(iPrimN);
+ for(Int_t iHitN=0;iHitN<Hits()->GetEntries();iHitN++){//loop on hits for given primary track
+ AddSDigit(4,13,24,55,4);//chamber-xpad-ypad-qdc-track1-2-3
+ }//loop on hits for given primary track
+ }//loop on primary tracks
+
+ fLoader->TreeS()->Fill();
+ fLoader->WriteSDigits("OVERWRITE");
+ }//loop on events
+
+ if(GetDebug()) Info("Hit2SDigits","Stop.");
}
-
-//___________________________________________
-void AliRICH::SDigits2Digits(Int_t nev, Int_t flag)
-{
-// Generate digits.
-// Called from macro. Multiple events, more functionality.
- if(IsDebugDigit()) cout<<ClassName()<<"::SDigits2Digits()>\n";
-
+//______________________________________________________________________________
+void AliRICH::SDigits2Digits()
+{//Generate digits from sdigits.
+ if(GetDebug()) Info("SDigits2Digits","Start.");
//AliRICHChamber* iChamber;
- //printf("Generating tresholds...\n");
//for(Int_t i=0;i<7;i++) {
//iChamber = &(Chamber(i));
manager->SetInputStream(0,"galice.root");
//AliRICHDigitizer *dRICH = new AliRICHDigitizer(manager);
manager->Exec("deb");
-
-}
-//___________________________________________
-void AliRICH::SDigits2Digits()
-{
- SDigits2Digits(0,0);
-}
-//___________________________________________
+ if(GetDebug()) Info("SDigits2Digits","Stop.");
+}//void AliRICH::SDigits2Digits()
+//______________________________________________________________________________
void AliRICH::Digits2Reco()
{
// Generate clusters
// Called from alirun, single event only.
- if(IsDebugDigit()||IsDebugReco()) cout<<ClassName()<<"::Digits2Reco()>\n";
-
+ if(GetDebug()) Info("Digits2Reco","Start.");
int nparticles = gAlice->GetNtrack();
cout << "Particles (RICH):" <<nparticles<<endl;
- if (nparticles > 0) FindClusters(0,0);
-
-}
-
-void AliRICH::AddHit(Int_t track, Int_t *vol, Float_t *hits)
-{
-// Adds the current hit to the RICH hits list
- if(IsDebugHit()) cout<<ClassName()<<"::AddHit(...)>\n";
-
- TClonesArray &lhits = *fHits;
- new(lhits[fNhits++]) AliRICHHit(fIshunt,track,vol,hits);
-}
+ if (nparticles > 0) FindClusters(0);
-void AliRICH::AddCerenkov(Int_t track, Int_t *vol, Float_t *cerenkovs)
-{
-// Adds a RICH cerenkov hit to the Cerenkov Hits list
- if(IsDebugHit()) cout<<ClassName()<<"::AddCerenkov()>\n";
-
- TClonesArray &lcerenkovs = *fCerenkovs;
- new(lcerenkovs[fNcerenkovs++]) AliRICHCerenkov(fIshunt,track,vol,cerenkovs);
-}
-
-void AliRICH::AddSDigit(Int_t *aSDigit)
-{
-// Adds the current S digit to the RICH list of S digits
- if(IsDebugDigit()) cout<<ClassName()<<"::AddSDigit()>\n";
-
- TClonesArray &lSDigits = *fSDigits;
- new(lSDigits[fNSDigits++]) AliRICHSDigit(aSDigit);
-}
+}//void AliRICH::Digits2Reco()
void AliRICH::AddDigits(Int_t id, Int_t *tracks, Int_t *charges, Int_t *digits)
-{
-// Add a RICH digit to the list
- if(IsDebugDigit()) cout<<ClassName()<<"::AddDigit()>\n";
+{// Add a RICH digit to the list
TClonesArray &ldigits = *((TClonesArray*)fDchambers->At(id));
new(ldigits[fNdch[id]++]) AliRICHDigit(tracks,charges,digits);
}
void AliRICH::AddRawCluster(Int_t id, const AliRICHRawCluster& c)
-{
-// Add a RICH digit to the list
+{// Add a RICH digit to the list
- if(IsDebugStart())
- cout<<ClassName()<<"::AddRawCluster()>\n";
-
- //PH TClonesArray &lrawcl = *((TClonesArray*)(*fRawClusters)[id]);
TClonesArray &lrawcl = *((TClonesArray*)fRawClusters->At(id));
new(lrawcl[fNrawch[id]++]) AliRICHRawCluster(c);
}
-
//_____________________________________________________________________________
void AliRICH::AddRecHit1D(Int_t id, Float_t *rechit, Float_t *photons, Int_t *padsx, Int_t* padsy)
-{
-
- //
- // Add a RICH reconstructed hit to the list
- //
+{// Add a RICH reconstructed hit to the list
- //PH TClonesArray &lrec1D = *((TClonesArray*)(*fRecHits1D)[id]);
TClonesArray &lrec1D = *((TClonesArray*)fRecHits1D->At(id));
new(lrec1D[fNrechits1D[id]++]) AliRICHRecHit1D(id,rechit,photons,padsx,padsy);
}
-
//_____________________________________________________________________________
void AliRICH::AddRecHit3D(Int_t id, Float_t *rechit, Float_t omega, Float_t theta, Float_t phi)
-{
-// Add a RICH reconstructed hit to the list
+{// Add a RICH reconstructed hit to the list
TClonesArray &lrec3D = *((TClonesArray*)fRecHits3D->At(id));
new(lrec3D[fNrechits3D[id]++]) AliRICHRecHit3D(id,rechit,omega,theta,phi);
}
-
-//___________________________________________
-void AliRICH::BuildGeometry()
-
-{
+//______________________________________________________________________________
+void AliRICH::BuildGeometry()
+{//Builds a TNode geometry for event display
+ if(GetDebug())Info("BuildGeometry","Start.");
- //
- // Builds a TNode geometry for event display
- //
- TNode *node, *subnode, *top;
-
- const int kColorRICH = kRed;
- //
- top=gAlice->GetGeometry()->GetNode("alice");
-
- AliRICH *pRICH = (AliRICH *) gAlice->GetDetector("RICH");
- AliRICHSegmentationV0* segmentation;
- AliRICHChamber* iChamber;
- AliRICHGeometry* geometry;
-
- iChamber = &(pRICH->Chamber(0));
- segmentation=(AliRICHSegmentationV0*) iChamber->GetSegmentationModel();
- geometry=iChamber->GetGeometryModel();
-
- new TBRIK("S_RICH","S_RICH","void",71.09999,11.5,73.15);
-
- Float_t padplane_width = segmentation->GetPadPlaneWidth();
- Float_t padplane_length = segmentation->GetPadPlaneLength();
-
- //printf("\n\n\n\n\n In BuildGeometry() npx: %d, npy: %d, dpx: %f, dpy:%f\n\n\n\n\n\n",segmentation->Npx(),segmentation->Npy(),segmentation->Dpx(),segmentation->Dpy());
-
- new TBRIK("PHOTO","PHOTO","void", padplane_width/2,.1,padplane_length/2);
-
- //printf("\n\n\n\n\n Padplane w: %f l: %f \n\n\n\n\n", padplane_width/2,padplane_length/2);
- //printf("\n\n\n\n\n Padplane w: %f l: %f \n\n\n\n\n", segmentation->GetPadPlaneWidth(), segmentation->GetPadPlaneLength());
+ TNode *node, *subnode, *top;
+ top=gAlice->GetGeometry()->GetNode("alice");
- Float_t offset = 490 + 1.276 - geometry->GetGapThickness()/2; //distance from center of mother volume to methane
- Float_t deltaphi = 19.5; //phi angle between center of chambers - z direction
- Float_t deltatheta = 20; //theta angle between center of chambers - x direction
- Float_t cosphi = TMath::Cos(deltaphi*TMath::Pi()/180);
- Float_t sinphi = TMath::Sin(deltaphi*TMath::Pi()/180);
- Float_t costheta = TMath::Cos(deltatheta*TMath::Pi()/180);
- Float_t sintheta = TMath::Sin(deltatheta*TMath::Pi()/180);
-
- //printf("\n\n%f %f %f %f %f %f %f\n\n",offset,deltatheta,deltaphi,cosphi,costheta,sinphi,sintheta);
-
- new TRotMatrix("rot993","rot993",90., 0. , 90. - deltaphi, 90. , deltaphi, -90. );
- new TRotMatrix("rot994","rot994",90., -deltatheta , 90. , 90.- deltatheta , 0. , 0. );
- new TRotMatrix("rot995","rot995",90., 0. , 90. , 90. , 0. , 0. );
- new TRotMatrix("rot996","rot996",90., deltatheta , 90. , 90 + deltatheta , 0. , 0. );
- new TRotMatrix("rot997","rot997",90., 360. - deltatheta, 108.2 , 90.- deltatheta ,18.2 , 90 - deltatheta);
- new TRotMatrix("rot998","rot998",90., 0. , 90 + deltaphi , 90. , deltaphi, 90. );
- new TRotMatrix("rot999","rot999",90., deltatheta , 108.2 , 90.+ deltatheta ,18.2 , 90 + deltatheta);
-
- Float_t pos1[3]={0. , offset*cosphi , offset*sinphi};
- Float_t pos2[3]={offset*sintheta , offset*costheta , 0. };
- Float_t pos3[3]={0. , offset , 0.};
- Float_t pos4[3]={-offset*sintheta , offset*costheta , 0.};
- Float_t pos5[3]={offset*sinphi , offset*costheta*cosphi, -offset*sinphi};
- Float_t pos6[3]={0. , offset*cosphi , -offset*sinphi};
- Float_t pos7[3]={ -offset*sinphi , offset*costheta*cosphi, -offset*sinphi};
-
-
- top->cd();
- //Float_t pos1[3]={0,471.8999,165.2599};
- //Chamber(0).SetChamberTransform(pos1[0],pos1[1],pos1[2],
- //new TRotMatrix("rot993","rot993",90,0,70.69,90,19.30999,-90);
- node = new TNode("RICH1","RICH1","S_RICH",pos1[0],pos1[1],pos1[2],"rot993");
- node->SetLineColor(kColorRICH);
- node->cd();
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- fNodes->Add(node);
-
-
- top->cd();
- //Float_t pos2[3]={171,470,0};
- //Chamber(1).SetChamberTransform(pos2[0],pos2[1],pos2[2],
- //new TRotMatrix("rot994","rot994",90,-20,90,70,0,0);
- node = new TNode("RICH2","RICH2","S_RICH",pos2[0],pos2[1],pos2[2],"rot994");
- node->SetLineColor(kColorRICH);
- node->cd();
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- fNodes->Add(node);
-
-
- top->cd();
- //Float_t pos3[3]={0,500,0};
- //Chamber(2).SetChamberTransform(pos3[0],pos3[1],pos3[2],
- //new TRotMatrix("rot995","rot995",90,0,90,90,0,0);
- node = new TNode("RICH3","RICH3","S_RICH",pos3[0],pos3[1],pos3[2],"rot995");
- node->SetLineColor(kColorRICH);
- node->cd();
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- fNodes->Add(node);
-
- top->cd();
- //Float_t pos4[3]={-171,470,0};
- //Chamber(3).SetChamberTransform(pos4[0],pos4[1],pos4[2],
- //new TRotMatrix("rot996","rot996",90,20,90,110,0,0);
- node = new TNode("RICH4","RICH4","S_RICH",pos4[0],pos4[1],pos4[2],"rot996");
- node->SetLineColor(kColorRICH);
- node->cd();
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- fNodes->Add(node);
-
+ new TBRIK("S_RICH","S_RICH","void",71.09999,11.5,73.15);
+ Float_t wid=fpParam->PadPlaneWidth();
+ Float_t len=fpParam->PadPlaneLength();
+ new TBRIK("PHOTO","PHOTO","void",wid/2,0.1,len/2);
+
+ for(int i=0;i<kNCH;i++){
top->cd();
- //Float_t pos5[3]={161.3999,443.3999,-165.3};
- //Chamber(4).SetChamberTransform(pos5[0],pos5[1],pos5[2],
- //new TRotMatrix("rot997","rot997",90,340,108.1999,70,18.2,70);
- node = new TNode("RICH5","RICH5","S_RICH",pos5[0],pos5[1],pos5[2],"rot997");
- node->SetLineColor(kColorRICH);
+ node = new TNode(Form("RICH%i",i+1),Form("RICH%i",i+1),"S_RICH",C(i)->X(),C(i)->Y(),C(i)->Z(),C(i)->RotMatrixName());
+ node->SetLineColor(kRed);
node->cd();
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
+ subnode = new TNode("PHOTO1","PHOTO1","PHOTO",wid+fpParam->DeadZone(),5,len/2+fpParam->DeadZone()/2,"");
subnode->SetLineColor(kGreen);
fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
+ subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,len/2+fpParam->DeadZone()/2,"");
subnode->SetLineColor(kGreen);
fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
+ subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-wid-fpParam->DeadZone(),5,len/2+fpParam->DeadZone()/2,"");
subnode->SetLineColor(kGreen);
fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
+ subnode = new TNode("PHOTO1","PHOTO1","PHOTO",wid+fpParam->DeadZone(),5,-len/2-fpParam->DeadZone()/2,"");
subnode->SetLineColor(kGreen);
fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
+ subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-len/2 -fpParam->DeadZone()/2,"");
subnode->SetLineColor(kGreen);
fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
+ subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-wid-fpParam->DeadZone(),5,-len/2 - fpParam->DeadZone()/2,"");
subnode->SetLineColor(kGreen);
fNodes->Add(subnode);
fNodes->Add(node);
-
-
- top->cd();
- //Float_t pos6[3]={0., 471.9, -165.3,};
- //Chamber(5).SetChamberTransform(pos6[0],pos6[1],pos6[2],
- //new TRotMatrix("rot998","rot998",90,0,109.3099,90,19.30999,90);
- node = new TNode("RICH6","RICH6","S_RICH",pos6[0],pos6[1],pos6[2],"rot998");
- node->SetLineColor(kColorRICH);
- fNodes->Add(node);node->cd();
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
-
-
- top->cd();
- //Float_t pos7[3]={-161.399,443.3999,-165.3};
- //Chamber(6).SetChamberTransform(pos7[0],pos7[1],pos7[2],
- //new TRotMatrix("rot999","rot999",90,20,108.1999,110,18.2,110);
- node = new TNode("RICH7","RICH7","S_RICH",pos7[0],pos7[1],pos7[2],"rot999");
- node->SetLineColor(kColorRICH);
- node->cd();
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
- subnode->SetLineColor(kGreen);
- fNodes->Add(subnode);
- fNodes->Add(node);
-
-}
-
-//___________________________________________
-void AliRICH::CreateGeometry()
-{
- //
- // Create the geometry for RICH version 1
- //
- // Modified by: N. Colonna (INFN - BARI, Nicola.Colonna@ba.infn.it)
- // R.A. Fini (INFN - BARI, Rosanna.Fini@ba.infn.it)
- // R.A. Loconsole (Bari University, loco@riscom.ba.infn.it)
- //
- //Begin_Html
- /*
- <img src="picts/AliRICHv1.gif">
- */
- //End_Html
- //Begin_Html
- /*
- <img src="picts/AliRICHv1Tree.gif">
- */
- //End_Html
-
- AliRICH *pRICH = (AliRICH *) gAlice->GetDetector("RICH");
- AliRICHSegmentationV0* segmentation;
- AliRICHGeometry* geometry;
- AliRICHChamber* iChamber;
-
- iChamber = &(pRICH->Chamber(0));
- segmentation=(AliRICHSegmentationV0*) iChamber->GetSegmentationModel();
- geometry=iChamber->GetGeometryModel();
-
- Float_t distance;
- distance = geometry->GetFreonThickness()/2 + geometry->GetQuartzThickness() + geometry->GetGapThickness();
- geometry->SetRadiatorToPads(distance);
-
- //Opaque quartz thickness
- Float_t oqua_thickness = .5;
- //CsI dimensions
-
- //Float_t csi_length = 160*.8 + 2.6;
- //Float_t csi_width = 144*.84 + 2*2.6;
-
- Float_t csi_width = segmentation->Npx()*segmentation->Dpx() + segmentation->DeadZone();
- Float_t csi_length = segmentation->Npy()*segmentation->Dpy() + 2*segmentation->DeadZone();
-
- //printf("\n\n\n\n\n In CreateGeometry() npx: %d, npy: %d, dpx: %f, dpy:%f deadzone: %f \n\n\n\n\n\n",segmentation->Npx(),segmentation->Npy(),segmentation->Dpx(),segmentation->Dpy(),segmentation->DeadZone());
-
- Int_t *idtmed = fIdtmed->GetArray()-999;
-
- Int_t i;
- Float_t zs;
- Int_t idrotm[1099];
- Float_t par[3];
-
- // --- Define the RICH detector
- // External aluminium box
- par[0] = 68.8;
- par[1] = 13; //Original Settings
- par[2] = 70.86;
- /*par[0] = 73.15;
- par[1] = 11.5;
- par[2] = 71.1;*/
- gMC->Gsvolu("RICH", "BOX ", idtmed[1009], par, 3);
-
- // Air
- par[0] = 66.3;
- par[1] = 13; //Original Settings
- par[2] = 68.35;
- /*par[0] = 66.55;
- par[1] = 11.5;
- par[2] = 64.8;*/
- gMC->Gsvolu("SRIC", "BOX ", idtmed[1000], par, 3);
-
- // Air 2 (cutting the lower part of the box)
-
- par[0] = 1.25;
- par[1] = 3; //Original Settings
- par[2] = 70.86;
- gMC->Gsvolu("AIR2", "BOX ", idtmed[1000], par, 3);
-
- // Air 3 (cutting the lower part of the box)
-
- par[0] = 66.3;
- par[1] = 3; //Original Settings
- par[2] = 1.2505;
- gMC->Gsvolu("AIR3", "BOX ", idtmed[1000], par, 3);
-
- // Honeycomb
- par[0] = 66.3;
- par[1] = .188; //Original Settings
- par[2] = 68.35;
- /*par[0] = 66.55;
- par[1] = .188;
- par[2] = 63.1;*/
- gMC->Gsvolu("HONE", "BOX ", idtmed[1001], par, 3);
-
- // Aluminium sheet
- par[0] = 66.3;
- par[1] = .025; //Original Settings
- par[2] = 68.35;
- /*par[0] = 66.5;
- par[1] = .025;
- par[2] = 63.1;*/
- gMC->Gsvolu("ALUM", "BOX ", idtmed[1009], par, 3);
-
- // Quartz
- par[0] = geometry->GetQuartzWidth()/2;
- par[1] = geometry->GetQuartzThickness()/2;
- par[2] = geometry->GetQuartzLength()/2;
- /*par[0] = 63.1;
- par[1] = .25; //Original Settings
- par[2] = 65.5;*/
- /*par[0] = geometry->GetQuartzWidth()/2;
- par[1] = geometry->GetQuartzThickness()/2;
- par[2] = geometry->GetQuartzLength()/2;*/
- //printf("\n\n\n\n\n\n\n\\n\n\n\n Gap Thickness: %f %f %f\n\n\n\n\n\n\n\n\n\n\n\n\n\n",par[0],par[1],par[2]);
- gMC->Gsvolu("QUAR", "BOX ", idtmed[1002], par, 3);
-
- // Spacers (cylinders)
- par[0] = 0.;
- par[1] = .5;
- par[2] = geometry->GetFreonThickness()/2;
- gMC->Gsvolu("SPAC", "TUBE", idtmed[1002], par, 3);
-
- // Feet (freon slabs supports)
-
- par[0] = .7;
- par[1] = .3;
- par[2] = 1.9;
- gMC->Gsvolu("FOOT", "BOX", idtmed[1009], par, 3);
-
- // Opaque quartz
- par[0] = geometry->GetQuartzWidth()/2;
- par[1] = .2;
- par[2] = geometry->GetQuartzLength()/2;
- /*par[0] = 61.95;
- par[1] = .2; //Original Settings
- par[2] = 66.5;*/
- /*par[0] = 66.5;
- par[1] = .2;
- par[2] = 61.95;*/
- gMC->Gsvolu("OQUA", "BOX ", idtmed[1007], par, 3);
-
- // Frame of opaque quartz
- par[0] = geometry->GetOuterFreonWidth()/2;
- //+ oqua_thickness;
- par[1] = geometry->GetFreonThickness()/2;
- par[2] = geometry->GetOuterFreonLength()/2;
- //+ oqua_thickness;
- /*par[0] = 20.65;
- par[1] = .5; //Original Settings
- par[2] = 66.5;*/
- /*par[0] = 66.5;
- par[1] = .5;
- par[2] = 20.65;*/
- gMC->Gsvolu("OQF1", "BOX ", idtmed[1007], par, 3);
-
- par[0] = geometry->GetInnerFreonWidth()/2;
- par[1] = geometry->GetFreonThickness()/2;
- par[2] = geometry->GetInnerFreonLength()/2;
- gMC->Gsvolu("OQF2", "BOX ", idtmed[1007], par, 3);
-
- // Little bar of opaque quartz
- //par[0] = .275;
- //par[1] = geometry->GetQuartzThickness()/2;
- //par[2] = geometry->GetInnerFreonLength()/2 - 2.4;
- //par[2] = geometry->GetInnerFreonLength()/2;
- //+ oqua_thickness;
- /*par[0] = .275;
- par[1] = .25; //Original Settings
- par[2] = 63.1;*/
- /*par[0] = 63.1;
- par[1] = .25;
- par[2] = .275;*/
- //gMC->Gsvolu("BARR", "BOX ", idtmed[1007], par, 3);
-
- // Freon
- par[0] = geometry->GetOuterFreonWidth()/2 - oqua_thickness;
- par[1] = geometry->GetFreonThickness()/2;
- par[2] = geometry->GetOuterFreonLength()/2 - 2*oqua_thickness;
- /*par[0] = 20.15;
- par[1] = .5; //Original Settings
- par[2] = 65.5;*/
- /*par[0] = 65.5;
- par[1] = .5;
- par[2] = 20.15;*/
- gMC->Gsvolu("FRE1", "BOX ", idtmed[1003], par, 3);
-
- par[0] = geometry->GetInnerFreonWidth()/2 - oqua_thickness;
- par[1] = geometry->GetFreonThickness()/2;
- par[2] = geometry->GetInnerFreonLength()/2 - 2*oqua_thickness;
- gMC->Gsvolu("FRE2", "BOX ", idtmed[1003], par, 3);
-
- // Methane
- //par[0] = 64.8;
- par[0] = csi_width/2;
- par[1] = geometry->GetGapThickness()/2;
- //printf("\n\n\n\n\n\n\n\\n\n\n\n Gap Thickness: %f\n\n\n\n\n\n\n\n\n\n\n\n\n\n",par[1]);
- //par[2] = 64.8;
- par[2] = csi_length/2;
- gMC->Gsvolu("META", "BOX ", idtmed[1004], par, 3);
-
- // Methane gap
- //par[0] = 64.8;
- par[0] = csi_width/2;
- par[1] = geometry->GetProximityGapThickness()/2;
- //printf("\n\n\n\n\n\n\n\\n\n\n\n Gap Thickness: %f\n\n\n\n\n\n\n\n\n\n\n\n\n\n",par[1]);
- //par[2] = 64.8;
- par[2] = csi_length/2;
- gMC->Gsvolu("GAP ", "BOX ", idtmed[1008], par, 3);
-
- // CsI photocathode
- //par[0] = 64.8;
- par[0] = csi_width/2;
- par[1] = .25;
- //par[2] = 64.8;
- par[2] = csi_length/2;
- gMC->Gsvolu("CSI ", "BOX ", idtmed[1005], par, 3);
-
- // Anode grid
- par[0] = 0.;
- par[1] = .001;
- par[2] = 20.;
- gMC->Gsvolu("GRID", "TUBE", idtmed[1006], par, 3);
-
- // Wire supports
- // Bar of metal
-
- par[0] = csi_width/2;
- par[1] = 1.05;
- par[2] = 1.05;
- gMC->Gsvolu("WSMe", "BOX ", idtmed[1009], par, 3);
-
- // Ceramic pick up (base)
-
- par[0] = csi_width/2;
- par[1] = .25;
- par[2] = 1.05;
- gMC->Gsvolu("WSG1", "BOX ", idtmed[1010], par, 3);
-
- // Ceramic pick up (head)
-
- par[0] = csi_width/2;
- par[1] = .1;
- par[2] = .1;
- gMC->Gsvolu("WSG2", "BOX ", idtmed[1010], par, 3);
-
- // Aluminium supports for methane and CsI
- // Short bar
-
- par[0] = csi_width/2;
- par[1] = geometry->GetGapThickness()/2 + .25;
- par[2] = (68.35 - csi_length/2)/2;
- gMC->Gsvolu("SMSH", "BOX", idtmed[1009], par, 3);
-
- // Long bar
-
- par[0] = (66.3 - csi_width/2)/2;
- par[1] = geometry->GetGapThickness()/2 + .25;
- par[2] = csi_length/2 + 68.35 - csi_length/2;
- gMC->Gsvolu("SMLG", "BOX", idtmed[1009], par, 3);
-
- // Aluminium supports for freon
- // Short bar
-
- par[0] = geometry->GetQuartzWidth()/2;
- par[1] = .3;
- par[2] = (68.35 - geometry->GetQuartzLength()/2)/2;
- gMC->Gsvolu("SFSH", "BOX", idtmed[1009], par, 3);
-
- // Long bar
-
- par[0] = (66.3 - geometry->GetQuartzWidth()/2)/2;
- par[1] = .3;
- par[2] = geometry->GetQuartzLength()/2 + 68.35 - geometry->GetQuartzLength()/2;
- gMC->Gsvolu("SFLG", "BOX", idtmed[1009], par, 3);
-
- // PCB backplane
-
- par[0] = csi_width/2;
- par[1] = .25;
- par[2] = csi_length/4 -.5025;
- gMC->Gsvolu("PCB ", "BOX", idtmed[1011], par, 3);
-
-
- // Backplane supports
-
- // Aluminium slab
-
- par[0] = 33.15;
- par[1] = 2;
- par[2] = 21.65;
- gMC->Gsvolu("BACK", "BOX", idtmed[1009], par, 3);
-
- // Big hole
-
- par[0] = 9.05;
- par[1] = 2;
- par[2] = 4.4625;
- gMC->Gsvolu("BKHL", "BOX", idtmed[1000], par, 3);
-
- // Small hole
-
- par[0] = 5.7;
- par[1] = 2;
- par[2] = 4.4625;
- gMC->Gsvolu("BKHS", "BOX", idtmed[1000], par, 3);
-
- // Place holes inside backplane support
-
- gMC->Gspos("BKHS", 1, "BACK", .8 + 5.7,0., .6 + 4.4625, 0, "ONLY");
- gMC->Gspos("BKHS", 2, "BACK", -.8 - 5.7,0., .6 + 4.4625, 0, "ONLY");
- gMC->Gspos("BKHS", 3, "BACK", .8 + 5.7,0., -.6 - 4.4625, 0, "ONLY");
- gMC->Gspos("BKHS", 4, "BACK", -.8 - 5.7,0., -.6 - 4.4625, 0, "ONLY");
- gMC->Gspos("BKHS", 5, "BACK", .8 + 5.7,0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
- gMC->Gspos("BKHS", 6, "BACK", -.8 - 5.7,0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
- gMC->Gspos("BKHS", 7, "BACK", .8 + 5.7,0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
- gMC->Gspos("BKHS", 8, "BACK", -.8 - 5.7,0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
- gMC->Gspos("BKHL", 1, "BACK", .8 + 11.4 + 1.6 + 9.05, 0., .6 + 4.4625, 0, "ONLY");
- gMC->Gspos("BKHL", 2, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., .6 + 4.4625, 0, "ONLY");
- gMC->Gspos("BKHL", 3, "BACK", .8 + 11.4 + 1.6 + 9.05, 0., -.6 - 4.4625, 0, "ONLY");
- gMC->Gspos("BKHL", 4, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., -.6 - 4.4625, 0, "ONLY");
- gMC->Gspos("BKHL", 5, "BACK", .8 + 11.4+ 1.6 + 9.05, 0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
- gMC->Gspos("BKHL", 6, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
- gMC->Gspos("BKHL", 7, "BACK", .8 + 11.4 + 1.6 + 9.05, 0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
- gMC->Gspos("BKHL", 8, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
-
-
-
- // --- Places the detectors defined with GSVOLU
- // Place material inside RICH
- gMC->Gspos("SRIC", 1, "RICH", 0.,0., 0., 0, "ONLY");
- gMC->Gspos("AIR2", 1, "RICH", 66.3 + 1.2505, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, 0., 0, "ONLY");
- gMC->Gspos("AIR2", 2, "RICH", -66.3 - 1.2505, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, 0., 0, "ONLY");
- gMC->Gspos("AIR3", 1, "RICH", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, -68.35 - 1.25, 0, "ONLY");
- gMC->Gspos("AIR3", 2, "RICH", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, 68.35 + 1.25, 0, "ONLY");
-
-
- gMC->Gspos("ALUM", 1, "SRIC", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .05 - .376 -.025, 0., 0, "ONLY");
- gMC->Gspos("HONE", 1, "SRIC", 0., 1.276- geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .05 - .188, 0., 0, "ONLY");
- gMC->Gspos("ALUM", 2, "SRIC", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .025, 0., 0, "ONLY");
- gMC->Gspos("FOOT", 1, "SRIC", 64.95, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, 36.9, 0, "ONLY");
- gMC->Gspos("FOOT", 2, "SRIC", 21.65, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3 , 36.9, 0, "ONLY");
- gMC->Gspos("FOOT", 3, "SRIC", -21.65, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, 36.9, 0, "ONLY");
- gMC->Gspos("FOOT", 4, "SRIC", -64.95, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, 36.9, 0, "ONLY");
- gMC->Gspos("FOOT", 5, "SRIC", 64.95, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, -36.9, 0, "ONLY");
- gMC->Gspos("FOOT", 6, "SRIC", 21.65, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, -36.9, 0, "ONLY");
- gMC->Gspos("FOOT", 7, "SRIC", -21.65, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, -36.9, 0, "ONLY");
- gMC->Gspos("FOOT", 8, "SRIC", -64.95, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, -36.9, 0, "ONLY");
- gMC->Gspos("OQUA", 1, "SRIC", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .2, 0., 0, "ONLY");
-
- // Supports placing
-
- // Methane supports
- gMC->Gspos("SMLG", 1, "SRIC", csi_width/2 + (66.3 - csi_width/2)/2, 1.276 + .25, 0., 0, "ONLY");
- gMC->Gspos("SMLG", 2, "SRIC", - csi_width/2 - (66.3 - csi_width/2)/2, 1.276 + .25, 0., 0, "ONLY");
- gMC->Gspos("SMSH", 1, "SRIC", 0., 1.276 + .25, csi_length/2 + (68.35 - csi_length/2)/2, 0, "ONLY");
- gMC->Gspos("SMSH", 2, "SRIC", 0., 1.276 + .25, - csi_length/2 - (68.35 - csi_length/2)/2, 0, "ONLY");
-
- //Freon supports
-
- Float_t supp_y = 1.276 - geometry->GetGapThickness()/2- geometry->GetQuartzThickness() -geometry->GetFreonThickness() - .2 + .3; //y position of freon supports
-
- gMC->Gspos("SFLG", 1, "SRIC", geometry->GetQuartzWidth()/2 + (66.3 - geometry->GetQuartzWidth()/2)/2, supp_y, 0., 0, "ONLY");
- gMC->Gspos("SFLG", 2, "SRIC", - geometry->GetQuartzWidth()/2 - (66.3 - geometry->GetQuartzWidth()/2)/2, supp_y, 0., 0, "ONLY");
- gMC->Gspos("SFSH", 1, "SRIC", 0., supp_y, geometry->GetQuartzLength()/2 + (68.35 - geometry->GetQuartzLength()/2)/2, 0, "ONLY");
- gMC->Gspos("SFSH", 2, "SRIC", 0., supp_y, - geometry->GetQuartzLength()/2 - (68.35 - geometry->GetQuartzLength()/2)/2, 0, "ONLY");
-
- AliMatrix(idrotm[1019], 0., 0., 90., 0., 90., 90.);
-
- //Placing of the spacers inside the freon slabs
-
- Int_t nspacers = 30;
- //printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n Spacers:%d\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",nspacers);
-
- //printf("Nspacers: %d", nspacers);
-
- for (i = 0; i < nspacers/3; i++) {
- zs = -11.6/2 + (TMath::Abs(nspacers/6) - i) * 12.2;
- gMC->Gspos("SPAC", i, "FRE1", 10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
- }
-
- for (i = nspacers/3; i < (nspacers*2)/3; i++) {
- zs = -11.6/2 + (nspacers/3 + TMath::Abs(nspacers/6) - i) * 12.2;
- gMC->Gspos("SPAC", i, "FRE1", 0, 0., zs, idrotm[1019], "ONLY"); //Original settings
- }
-
- for (i = (nspacers*2)/3; i < nspacers; ++i) {
- zs = -11.6/2 + ((nspacers*2)/3 + TMath::Abs(nspacers/6) - i) * 12.2;
- gMC->Gspos("SPAC", i, "FRE1", -10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
- }
-
- for (i = 0; i < nspacers/3; i++) {
- zs = -11.6/2 + (TMath::Abs(nspacers/6) - i) * 12.2;
- gMC->Gspos("SPAC", i, "FRE2", 10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
- }
-
- for (i = nspacers/3; i < (nspacers*2)/3; i++) {
- zs = -11.6/2 + (nspacers/3 + TMath::Abs(nspacers/6) - i) * 12.2;
- gMC->Gspos("SPAC", i, "FRE2", 0, 0., zs, idrotm[1019], "ONLY"); //Original settings
- }
-
- for (i = (nspacers*2)/3; i < nspacers; ++i) {
- zs = -11.6/2 + ((nspacers*2)/3 + TMath::Abs(nspacers/6) - i) * 12.2;
- gMC->Gspos("SPAC", i, "FRE2", -10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
- }
-
-
- gMC->Gspos("FRE1", 1, "OQF1", 0., 0., 0., 0, "ONLY");
- gMC->Gspos("FRE2", 1, "OQF2", 0., 0., 0., 0, "ONLY");
- gMC->Gspos("OQF1", 1, "SRIC", geometry->GetOuterFreonWidth()/2 + geometry->GetInnerFreonWidth()/2 + 2, 1.276 - geometry->GetGapThickness()/2- geometry->GetQuartzThickness() -geometry->GetFreonThickness()/2, 0., 0, "ONLY"); //Original settings (31.3)
-// printf("Opaque quartz in SRIC %f\n", 1.276 - geometry->GetGapThickness()/2- geometry->GetQuartzThickness() -geometry->GetFreonThickness()/2);
- gMC->Gspos("OQF2", 2, "SRIC", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()/2, 0., 0, "ONLY"); //Original settings
- gMC->Gspos("OQF1", 3, "SRIC", - (geometry->GetOuterFreonWidth()/2 + geometry->GetInnerFreonWidth()/2) - 2, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()/2, 0., 0, "ONLY"); //Original settings (-31.3)
- //gMC->Gspos("BARR", 1, "QUAR", - geometry->GetInnerFreonWidth()/2 - oqua_thickness, 0., 0., 0, "ONLY"); //Original settings (-21.65)
- //gMC->Gspos("BARR", 2, "QUAR", geometry->GetInnerFreonWidth()/2 + oqua_thickness, 0., 0., 0, "ONLY"); //Original settings (21.65)
- gMC->Gspos("QUAR", 1, "SRIC", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness()/2, 0., 0, "ONLY");
- gMC->Gspos("GAP ", 1, "META", 0., geometry->GetGapThickness()/2 - geometry->GetProximityGapThickness()/2 - 0.0001, 0., 0, "ONLY");
- gMC->Gspos("META", 1, "SRIC", 0., 1.276, 0., 0, "ONLY");
- gMC->Gspos("CSI ", 1, "SRIC", 0., 1.276 + geometry->GetGapThickness()/2 + .25, 0., 0, "ONLY");
- printf("CSI pos: %f\n",1.276 + geometry->GetGapThickness()/2 + .25);
-
- // Wire support placing
-
- gMC->Gspos("WSG2", 1, "GAP ", 0., geometry->GetProximityGapThickness()/2 - .1, 0., 0, "ONLY");
- gMC->Gspos("WSG1", 1, "CSI ", 0., 0., 0., 0, "ONLY");
- gMC->Gspos("WSMe", 1, "SRIC ", 0., 1.276 + geometry->GetGapThickness()/2 + .5 + 1.05, 0., 0, "ONLY");
-
- // Backplane placing
-
- gMC->Gspos("BACK", 1, "SRIC ", -33.15, 1.276 + geometry->GetGapThickness()/2 + .5 + 2.1 + 2, 43.3, 0, "ONLY");
- gMC->Gspos("BACK", 2, "SRIC ", 33.15, 1.276 + geometry->GetGapThickness()/2 + .5 + 2.1 + 2 , 43.3, 0, "ONLY");
- gMC->Gspos("BACK", 3, "SRIC ", -33.15, 1.276 + geometry->GetGapThickness()/2 + .5 + 2.1 + 2, 0., 0, "ONLY");
- gMC->Gspos("BACK", 4, "SRIC ", 33.15, 1.276 + geometry->GetGapThickness()/2 + .5 + 2.1 + 2, 0., 0, "ONLY");
- gMC->Gspos("BACK", 5, "SRIC ", 33.15, 1.276 + geometry->GetGapThickness()/2 + .5 + 2.1 + 2, -43.3, 0, "ONLY");
- gMC->Gspos("BACK", 6, "SRIC ", -33.15, 1.276 + geometry->GetGapThickness()/2 + .5 + 2.1 + 2, -43.3, 0, "ONLY");
-
- // PCB placing
-
- gMC->Gspos("PCB ", 1, "SRIC ", 0., 1.276 + geometry->GetGapThickness()/2 + .5 + 1.05, csi_width/4 + .5025 + 2.5, 0, "ONLY");
- gMC->Gspos("PCB ", 2, "SRIC ", 0., 1.276 + geometry->GetGapThickness()/2 + .5 + 1.05, -csi_width/4 - .5025 - 2.5, 0, "ONLY");
-
-
-
- //printf("Position of the gap: %f to %f\n", 1.276 + geometry->GetGapThickness()/2 - geometry->GetProximityGapThickness()/2 - .2, 1.276 + geometry->GetGapThickness()/2 - geometry->GetProximityGapThickness()/2 + .2);
-
- // Place RICH inside ALICE apparatus
-
- /* old values
-
- AliMatrix(idrotm[1000], 90., 0., 70.69, 90., 19.31, -90.);
- AliMatrix(idrotm[1001], 90., -20., 90., 70., 0., 0.);
- AliMatrix(idrotm[1002], 90., 0., 90., 90., 0., 0.);
- AliMatrix(idrotm[1003], 90., 20., 90., 110., 0., 0.);
- AliMatrix(idrotm[1004], 90., 340., 108.2, 70., 18.2, 70.);
- AliMatrix(idrotm[1005], 90., 0., 109.31, 90., 19.31, 90.);
- AliMatrix(idrotm[1006], 90., 20., 108.2, 110., 18.2, 110.);
-
- gMC->Gspos("RICH", 1, "ALIC", 0., 471.9, 165.26, idrotm[1000], "ONLY");
- gMC->Gspos("RICH", 2, "ALIC", 171., 470., 0., idrotm[1001], "ONLY");
- gMC->Gspos("RICH", 3, "ALIC", 0., 500., 0., idrotm[1002], "ONLY");
- gMC->Gspos("RICH", 4, "ALIC", -171., 470., 0., idrotm[1003], "ONLY");
- gMC->Gspos("RICH", 5, "ALIC", 161.4, 443.4, -165.3, idrotm[1004], "ONLY");
- gMC->Gspos("RICH", 6, "ALIC", 0., 471.9, -165.3, idrotm[1005], "ONLY");
- gMC->Gspos("RICH", 7, "ALIC", -161.4, 443.4, -165.3, idrotm[1006], "ONLY");*/
-
- // The placing of the chambers is measured from the vertex to the base of the methane vessel (490 cm)
-
- Float_t offset = 490 + 1.276 - geometry->GetGapThickness()/2; //distance from center of mother volume to methane
- Float_t deltaphi = 19.5; //phi angle between center of chambers - z direction
- Float_t deltatheta = 20; //theta angle between center of chambers - x direction
- Float_t cosphi = TMath::Cos(deltaphi*TMath::Pi()/180);
- Float_t sinphi = TMath::Sin(deltaphi*TMath::Pi()/180);
- Float_t costheta = TMath::Cos(deltatheta*TMath::Pi()/180);
- Float_t sintheta = TMath::Sin(deltatheta*TMath::Pi()/180);
-
- //printf("\n\n%f %f %f %f %f %f %f\n\n",offset,deltatheta,deltaphi,cosphi,costheta,sinphi,sintheta);
-
- AliMatrix(idrotm[1000], 90., 0. , 90. - deltaphi, 90. , deltaphi, -90. );
- AliMatrix(idrotm[1001], 90., -deltatheta , 90. , 90.- deltatheta , 0. , 0. );
- AliMatrix(idrotm[1002], 90., 0. , 90. , 90. , 0. , 0. );
- AliMatrix(idrotm[1003], 90., deltatheta , 90. , 90 + deltatheta , 0. , 0. );
- AliMatrix(idrotm[1004], 90., 360. - deltatheta, 108.2 , 90.- deltatheta ,18.2 , 90 - deltatheta);
- AliMatrix(idrotm[1005], 90., 0. , 90 + deltaphi , 90. , deltaphi, 90. );
- AliMatrix(idrotm[1006], 90., deltatheta , 108.2 , 90.+ deltatheta ,18.2 , 90 + deltatheta);
-
- gMC->Gspos("RICH", 1, "ALIC", 0. , offset*cosphi , offset*sinphi ,idrotm[1000], "ONLY");
- gMC->Gspos("RICH", 2, "ALIC", (offset)*sintheta , offset*costheta , 0. ,idrotm[1001], "ONLY");
- gMC->Gspos("RICH", 3, "ALIC", 0. , offset , 0. ,idrotm[1002], "ONLY");
- gMC->Gspos("RICH", 4, "ALIC", -(offset)*sintheta, offset*costheta , 0. ,idrotm[1003], "ONLY");
- gMC->Gspos("RICH", 5, "ALIC", (offset)*sinphi , offset*costheta*cosphi, -offset*sinphi,idrotm[1004], "ONLY");
- gMC->Gspos("RICH", 6, "ALIC", 0. , offset*cosphi , -offset*sinphi,idrotm[1005], "ONLY");
- gMC->Gspos("RICH", 7, "ALIC", -(offset)*sinphi , offset*costheta*cosphi, -offset*sinphi,idrotm[1006], "ONLY");
-
-}
-
-
-//___________________________________________
+ }
+ if(GetDebug())Info("BuildGeometry","Stop.");
+}//void AliRICH::BuildGeometry()
+//______________________________________________________________________________
void AliRICH::CreateMaterials()
{
//
for (i=0;i<26;i++)
{
ppckov[i] = (Float_t(i)*0.1+5.5)*1e-9;
- //printf ("Energy intervals: %e\n",ppckov[i]);
}
Float_t a=f1/(e1*e1 - ene*ene);
Float_t b=f2/(e2*e2 - ene*ene);
rIndexQuarz[i] = TMath::Sqrt(1. + a + b );
- //printf ("rIndexQuarz: %e\n",rIndexQuarz[i]);
}
//Refraction index for opaque quarz, methane and grid
rIndexOpaqueQuarz[i]=1;
rIndexMethane[i]=1.000444;
rIndexGrid[i]=1;
- //printf ("rIndexOpaqueQuarz , etc: %e, %e, %e\n",rIndexOpaqueQuarz[i], rIndexMethane[i], rIndexGrid[i]=1);
}
//Absorption index for freon
{
for (Int_t j=0;j<21;j++)
{
- //printf ("Passed\n");
if (Xlam > Wavl2[j] && Xlam < Wavl2[j+1])
{
Float_t Dabs = (Qzt[j+1] - Qzt[j])/(Wavl2[j+1] - Wavl2[j]);
}
}
}
- printf ("abscoQuarz: %e abscoFreon: %e for energy: %e\n",abscoQuarz[i],abscoFreon[i],ppckov[i]);
}*/
/*Float_t abscoQuarz[31] = {49.64211, 48.41296, 47.46989, 46.50492, 45.13682, 44.47883, 43.1929 , 41.30922, 40.5943 ,
for (i=0;i<26;i++)
{
abscoMethane[i]=AbsoCH4(ppckov[i]*1e9);
- //printf("abscoMethane: %e for energy: %e\n", abscoMethane[i],ppckov[i]*1e9);
}
//Absorption index for opaque quarz, csi and grid, efficiency for all and grid
abscoGrid[i]=1e-4;
efficAll[i]=1;
efficGrid[i]=1;
- //printf ("All must be 1: %e, %e, %e, %e, %e\n",abscoOpaqueQuarz[i],abscoCsI[i],abscoGrid[i],efficAll[i],efficGrid[i]);
}
//Efficiency for csi
for (i=0;i<26;i++)
{
efficCsI[i] = efficCsI[i]/(1.-Fresnel(ppckov[i]*1e9,1.,0));
- //printf ("Fresnel result: %e for energy: %e\n",Fresnel(ppckov[i]*1e9,1.,0),ppckov[i]*1e9);
}
/*******************************************End of rich_media.f***************************************/
for (i = 0; i < 26; ++i) {
rIndexFreon[i] = ppckov[i] * .0172 * 1e9 + 1.177;
//rIndexFreon[i] = 1;
- //printf ("rIndexFreon: %e \n efficCsI: %e for energy: %e\n",rIndexFreon[i], efficCsI[i], ppckov[i]);
}
// --- Detection efficiencies (quantum efficiency for CsI)
gMC->SetCerenkov(idtmed[1009], 26, ppckov, abscoGrid, efficGrid, rIndexGrid);
gMC->SetCerenkov(idtmed[1010], 26, ppckov, abscoOpaqueQuarz, efficAll, rIndexOpaqueQuarz);
}
-
-//___________________________________________
-
+//______________________________________________________________________________
Float_t AliRICH::Fresnel(Float_t ene,Float_t pdoti, Bool_t pola)
{
Float_t sw= b0+(b1*x)+(b2*x*x)+(b3*x*x*x)+(b4*x*x*x*x);
sw=sw*1e-18;
Float_t dw=(kWater/1e6)*kLosch*pn/tn;
- abslw=1./sw/dw;
- }
- else
- abslw=1.e18;
-
-// ---------------------------------------------------------
-
- Float_t alength=1./(1./abslm+1./absli+1./abslo+1./abslw);
- return (alength);
-}
-
-
-
-//___________________________________________
-Int_t AliRICH::DistancetoPrimitive(Int_t , Int_t )
-{
-
-// Default value
-
- return 9999;
-}
-
-//___________________________________________
-void AliRICH::MakeBranch(Option_t* option, const char *file)
-{
- // Create Tree branches for the RICH.
-
- const Int_t kBufferSize = 4000;
- char branchname[20];
-
- AliDetector::MakeBranch(option,file);
-
- const char *cH = strstr(option,"H");
- const char *cD = strstr(option,"D");
- const char *cR = strstr(option,"R");
- const char *cS = strstr(option,"S");
-
-
- if (cH) {
- sprintf(branchname,"%sCerenkov",GetName());
- if (fCerenkovs && gAlice->TreeH()) {
- //TBranch* branch = MakeBranchInTree(gAlice->TreeH(),branchname, &fCerenkovs, kBufferSize, file) ;
- MakeBranchInTree(gAlice->TreeH(),branchname, &fCerenkovs, kBufferSize, file) ;
- //branch->SetAutoDelete(kFALSE);
- }
- sprintf(branchname,"%sSDigits",GetName());
- if (fSDigits && gAlice->TreeH()) {
- //TBranch* branch = MakeBranchInTree(gAlice->TreeH(),branchname, &fSDigits, kBufferSize, file) ;
- MakeBranchInTree(gAlice->TreeH(),branchname, &fSDigits, kBufferSize, file) ;
- //branch->SetAutoDelete(kFALSE);
- //printf("Making branch %sSDigits in TreeH\n",GetName());
- }
- }
-
- if (cS) {
- sprintf(branchname,"%sSDigits",GetName());
- if (fSDigits && gAlice->TreeS()) {
- //TBranch* branch = MakeBranchInTree(gAlice->TreeS(),branchname, &fSDigits, kBufferSize, file) ;
- MakeBranchInTree(gAlice->TreeS(),branchname, &fSDigits, kBufferSize, file) ;
- //branch->SetAutoDelete(kFALSE);
- //printf("Making branch %sSDigits in TreeS\n",GetName());
- }
- }
-
- if (cD) {
- //
- // one branch for digits per chamber
- //
- Int_t i;
-
- for (i=0; i<kNCH ;i++) {
- sprintf(branchname,"%sDigits%d",GetName(),i+1);
- if (fDchambers && gAlice->TreeD()) {
- //TBranch* branch = MakeBranchInTree(gAlice->TreeD(),branchname, &((*fDchambers)[i]), kBufferSize, file) ;
- MakeBranchInTree(gAlice->TreeD(),branchname, &((*fDchambers)[i]), kBufferSize, file) ;
- //branch->SetAutoDelete(kFALSE);
- //printf("Making Branch %sDigits%d\n",GetName(),i+1);
- }
- }
- }
-
- if (cR) {
- //
- // one branch for raw clusters per chamber
- //
-
- //printf("Called MakeBranch for TreeR\n");
-
- Int_t i;
-
- for (i=0; i<kNCH ;i++) {
- sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
- if (fRawClusters && gAlice->TreeR()) {
- //TBranch* branch = MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRawClusters)[i]), kBufferSize, file) ;
- MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRawClusters)[i]), kBufferSize, file) ;
- //branch->SetAutoDelete(kFALSE);
- }
- }
- //
- // one branch for rec hits per chamber
- //
- for (i=0; i<kNCH ;i++) {
- sprintf(branchname,"%sRecHits1D%d",GetName(),i+1);
- if (fRecHits1D && gAlice->TreeR()) {
- //TBranch* branch = MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRecHits1D)[i]), kBufferSize, file) ;
- MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRecHits1D)[i]), kBufferSize, file) ;
- //branch->SetAutoDelete(kFALSE);
- }
- }
- for (i=0; i<kNCH ;i++) {
- sprintf(branchname,"%sRecHits3D%d",GetName(),i+1);
- if (fRecHits3D && gAlice->TreeR()) {
- MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRecHits3D)[i]), kBufferSize, file) ;
- //branch->SetAutoDelete(kFALSE);
- }
- }
- }
-}
-
-//___________________________________________
-void AliRICH::SetTreeAddress()
-{
- // Set branch address for the Hits and Digits Tree.
- char branchname[20];
- Int_t i;
-
- AliDetector::SetTreeAddress();
-
- TBranch *branch;
- TTree *treeH = gAlice->TreeH();
- TTree *treeD = gAlice->TreeD();
- TTree *treeR = gAlice->TreeR();
- TTree *treeS = gAlice->TreeS();
-
- if (treeH) {
- if (fCerenkovs) {
- branch = treeH->GetBranch("RICHCerenkov");
- if (branch) branch->SetAddress(&fCerenkovs);
- }
- if (fSDigits) {
- branch = treeH->GetBranch("RICHSDigits");
- if (branch)
- {
- branch->SetAddress(&fSDigits);
- //printf("Setting sdigits branch address at %p in TreeH\n",&fSDigits);
- }
- }
- }
-
- if (treeS) {
- if (fSDigits) {
- branch = treeS->GetBranch("RICHSDigits");
- if (branch)
- {
- branch->SetAddress(&fSDigits);
- //printf("Setting sdigits branch address at %p in TreeS\n",&fSDigits);
- }
- }
- }
-
-
- if (treeD) {
- for (int i=0; i<kNCH; i++) {
- sprintf(branchname,"%sDigits%d",GetName(),i+1);
- if (fDchambers) {
- branch = treeD->GetBranch(branchname);
- if (branch) branch->SetAddress(&((*fDchambers)[i]));
- }
- }
+ abslw=1./sw/dw;
}
- if (treeR) {
- for (i=0; i<kNCH; i++) {
- sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
- if (fRawClusters) {
- branch = treeR->GetBranch(branchname);
- if (branch) branch->SetAddress(&((*fRawClusters)[i]));
- }
- }
-
- for (i=0; i<kNCH; i++) {
- sprintf(branchname,"%sRecHits1D%d",GetName(),i+1);
- if (fRecHits1D) {
- branch = treeR->GetBranch(branchname);
- if (branch) branch->SetAddress(&((*fRecHits1D)[i]));
- }
- }
-
- for (i=0; i<kNCH; i++) {
- sprintf(branchname,"%sRecHits3D%d",GetName(),i+1);
- if (fRecHits3D) {
- branch = treeR->GetBranch(branchname);
- if (branch) branch->SetAddress(&((*fRecHits3D)[i]));
- }
- }
-
- }
-}
-//___________________________________________
-void AliRICH::ResetHits()
-{
- // Reset number of clusters and the cluster array for this detector
- AliDetector::ResetHits();
- fNSDigits = 0;
- fNcerenkovs = 0;
- if (fSDigits) fSDigits->Clear();
- if (fCerenkovs) fCerenkovs->Clear();
+ else
+ abslw=1.e18;
+
+// ---------------------------------------------------------
+
+ Float_t alength=1./(1./abslm+1./absli+1./abslo+1./abslw);
+ return (alength);
}
+
+//___________________________________________
//____________________________________________
void AliRICH::ResetDigits()
-{
- //
- // Reset number of digits and the digits array for this detector
- //
- for ( int i=0;i<kNCH;i++ ) {
- //PH if (fDchambers && (*fDchambers)[i]) (*fDchambers)[i]->Clear();
- if (fDchambers && fDchambers->At(i)) fDchambers->At(i)->Clear();
- if (fNdch) fNdch[i]=0;
- }
+{//Reset number of digits and the digits array for this detector
+ for ( int i=0;i<kNCH;i++ ) {
+ if (fDchambers && fDchambers->At(i)) fDchambers->At(i)->Clear();
+ if (fNdch) fNdch[i]=0;
+ }
}
-
//____________________________________________
void AliRICH::ResetRawClusters()
-{
- //
- // Reset number of raw clusters and the raw clust array for this detector
- //
- for ( int i=0;i<kNCH;i++ ) {
- //PH if ((*fRawClusters)[i]) ((TClonesArray*)(*fRawClusters)[i])->Clear();
- if (fRawClusters->At(i)) ((TClonesArray*)fRawClusters->At(i))->Clear();
- if (fNrawch) fNrawch[i]=0;
- }
+{//Reset number of raw clusters and the raw clust array for this detector
+ for ( int i=0;i<kNCH;i++ ) {
+ if (fRawClusters->At(i)) ((TClonesArray*)fRawClusters->At(i))->Clear();
+ if (fNrawch) fNrawch[i]=0;
+ }
}
-
//____________________________________________
void AliRICH::ResetRecHits1D()
-{
- //
- // Reset number of raw clusters and the raw clust array for this detector
- //
-
+{//Reset number of raw clusters and the raw clust array for this detector
for ( int i=0;i<kNCH;i++ ) {
- //PH if ((*fRecHits1D)[i]) ((TClonesArray*)(*fRecHits1D)[i])->Clear();
- if (fRecHits1D->At(i)) ((TClonesArray*)fRecHits1D->At(i))->Clear();
- if (fNrechits1D) fNrechits1D[i]=0;
- }
+ if (fRecHits1D->At(i)) ((TClonesArray*)fRecHits1D->At(i))->Clear();
+ if (fNrechits1D) fNrechits1D[i]=0;
+ }
}
//____________________________________________
void AliRICH::ResetRecHits3D()
-{
- //
- // Reset number of raw clusters and the raw clust array for this detector
- //
-
+{// Reset number of raw clusters and the raw clust array for this detector
for ( int i=0;i<kNCH;i++ ) {
- //PH if ((*fRecHits3D)[i]) ((TClonesArray*)(*fRecHits3D)[i])->Clear();
- if (fRecHits3D->At(i)) ((TClonesArray*)fRecHits3D->At(i))->Clear();
- if (fNrechits3D) fNrechits3D[i]=0;
- }
+ if (fRecHits3D->At(i)) ((TClonesArray*)fRecHits3D->At(i))->Clear();
+ if (fNrechits3D) fNrechits3D[i]=0;
+ }
}
-
-
-//___________________________________________
-void AliRICH::StepManager()
-{
-// Full Step Manager
-
- Int_t copy, id;
- static Int_t idvol;
- static Int_t vol[2];
- Int_t ipart;
- static Float_t hits[22];
- static Float_t ckovData[19];
- TLorentzVector position;
- TLorentzVector momentum;
- Float_t pos[3];
- Float_t mom[4];
- Float_t localPos[3];
- Float_t localMom[4];
- Float_t localTheta,localPhi;
- Float_t theta,phi;
- Float_t destep, step;
- Double_t ranf[2];
- Int_t nPads;
- Float_t coscerenkov;
- static Float_t eloss, xhit, yhit, tlength;
- const Float_t kBig=1.e10;
-
- TClonesArray &lhits = *fHits;
- TParticle *current = (TParticle*)(*gAlice->Particles())[gAlice->CurrentTrack()];
-
- //if (current->Energy()>1)
- //{
-
- // Only gas gap inside chamber
- // Tag chambers and record hits when track enters
-
-
- id=gMC->CurrentVolID(copy);
- idvol = copy-1;
- Float_t cherenkovLoss=0;
- //gAlice->KeepTrack(gAlice->CurrentTrack());
-
- gMC->TrackPosition(position);
- pos[0]=position(0);
- pos[1]=position(1);
- pos[2]=position(2);
- //bzero((char *)ckovData,sizeof(ckovData)*19);
- ckovData[1] = pos[0]; // X-position for hit
- ckovData[2] = pos[1]; // Y-position for hit
- ckovData[3] = pos[2]; // Z-position for hit
- ckovData[6] = 0; // dummy track length
- //ckovData[11] = gAlice->CurrentTrack();
-
- //printf("\n+++++++++++\nTrack: %d\n++++++++++++\n",gAlice->CurrentTrack());
-
- //AliRICH *RICH = (AliRICH *) gAlice->GetDetector("RICH");
-
- /********************Store production parameters for Cerenkov photons************************/
-//is it a Cerenkov photon?
- if (gMC->TrackPid() == 50000050) {
-
- //if (gMC->VolId("GAP ")==gMC->CurrentVolID(copy))
- //{
- Float_t ckovEnergy = current->Energy();
- //energy interval for tracking
- if (ckovEnergy > 5.6e-09 && ckovEnergy < 7.8e-09 )
- //if (ckovEnergy > 0)
- {
- if (gMC->IsTrackEntering()){ //is track entering?
- //printf("Track entered (1)\n");
- if (gMC->VolId("FRE1")==gMC->CurrentVolID(copy) || gMC->VolId("FRE2")==gMC->CurrentVolID(copy))
- { //is it in freo?
- if (gMC->IsNewTrack()){ //is it the first step?
- //printf("I'm in!\n");
- Int_t mother = current->GetFirstMother();
-
- //printf("Second Mother:%d\n",current->GetSecondMother());
-
- ckovData[10] = mother;
- ckovData[11] = gAlice->CurrentTrack();
- ckovData[12] = 1; //Media where photon was produced 1->Freon, 2->Quarz
- //printf("Produced in FREO\n");
- fCkovNumber++;
- fFreonProd=1;
- //printf("Index: %d\n",fCkovNumber);
- } //first step question
- } //freo question
-
- if (gMC->IsNewTrack()){ //is it first step?
- if (gMC->VolId("QUAR")==gMC->CurrentVolID(copy)) //is it in quarz?
- {
- ckovData[12] = 2;
- //printf("Produced in QUAR\n");
- } //quarz question
- } //first step question
-
- //printf("Before %d\n",fFreonProd);
- } //track entering question
-
- if (ckovData[12] == 1) //was it produced in Freon?
- //if (fFreonProd == 1)
- {
- if (gMC->IsTrackEntering()){ //is track entering?
- //printf("Track entered (2)\n");
- //printf("Current volume (should be META): %s\n",gMC->CurrentVolName());
- //printf("VolId: %d, CurrentVolID: %d\n",gMC->VolId("META"),gMC->CurrentVolID(copy));
- if (gMC->VolId("META")==gMC->CurrentVolID(copy)) //is it in gap?
- {
- //printf("Got in META\n");
- gMC->TrackMomentum(momentum);
- mom[0]=momentum(0);
- mom[1]=momentum(1);
- mom[2]=momentum(2);
- mom[3]=momentum(3);
-
- gMC->Gmtod(mom,localMom,2);
- Float_t cophi = TMath::Cos(TMath::ATan2(localMom[0], localMom[1]));
- Float_t t = (1. - .025 / cophi) * (1. - .05 / cophi);
- /**************** Photons lost in second grid have to be calculated by hand************/
- gMC->GetRandom()->RndmArray(1,ranf);
- if (ranf[0] > t) {
- gMC->StopTrack();
- ckovData[13] = 5;
- AddCerenkov(gAlice->CurrentTrack(),vol,ckovData);
- //printf("Added One (1)!\n");
- //printf("Lost one in grid\n");
- }
- /**********************************************************************************/
- } //gap
-
- //printf("Current volume (should be CSI) (1): %s\n",gMC->CurrentVolName());
- //printf("VolId: %d, CurrentVolID: %d\n",gMC->VolId("CSI "),gMC->CurrentVolID(copy));
- if (gMC->VolId("CSI ")==gMC->CurrentVolID(copy)) //is it in csi?
- {
- //printf("Got in CSI\n");
- gMC->TrackMomentum(momentum);
- mom[0]=momentum(0);
- mom[1]=momentum(1);
- mom[2]=momentum(2);
- mom[3]=momentum(3);
-
- gMC->Gmtod(mom,localMom,2);
- /********* Photons lost by Fresnel reflection have to be calculated by hand********/
- /***********************Cerenkov phtons (always polarised)*************************/
- Double_t localTc = localMom[0]*localMom[0]+localMom[2]*localMom[2];
- Double_t localRt = TMath::Sqrt(localTc);
- localTheta = Float_t(TMath::ATan2(localRt,Double_t(localMom[1])));
- Double_t cotheta = TMath::Abs(cos(localTheta));
- Float_t t = Fresnel(ckovEnergy*1e9,cotheta,1);
- gMC->GetRandom()->RndmArray(1,ranf);
- if (ranf[0] < t) {
- gMC->StopTrack();
- ckovData[13] = 6;
- AddCerenkov(gAlice->CurrentTrack(),vol,ckovData);
-
- //printf("Added One (2)!\n");
- //printf("Lost by Fresnel\n");
- }
- /**********************************************************************************/
- }
- } //track entering?
-
-
- /********************Evaluation of losses************************/
- /******************still in the old fashion**********************/
-
- TArrayI procs;
- Int_t i1 = gMC->StepProcesses(procs); //number of physics mechanisms acting on the particle
- for (Int_t i = 0; i < i1; ++i) {
- // Reflection loss
- if (procs[i] == kPLightReflection) { //was it reflected
- ckovData[13]=10;
- if (gMC->VolId("FRE1")==gMC->CurrentVolID(copy) || gMC->VolId("FRE2")==gMC->CurrentVolID(copy))
- ckovData[13]=1;
- if (gMC->CurrentVolID(copy) == gMC->VolId("QUAR"))
- ckovData[13]=2;
- //gMC->StopTrack();
- //AddCerenkov(gAlice->CurrentTrack(),vol,ckovData);
- } //reflection question
-
- // Absorption loss
- else if (procs[i] == kPLightAbsorption) { //was it absorbed?
- //printf("Got in absorption\n");
- ckovData[13]=20;
- if (gMC->VolId("FRE1")==gMC->CurrentVolID(copy) || gMC->VolId("FRE2")==gMC->CurrentVolID(copy))
- ckovData[13]=11;
- if (gMC->CurrentVolID(copy) == gMC->VolId("QUAR"))
- ckovData[13]=12;
- if (gMC->CurrentVolID(copy) == gMC->VolId("META"))
- ckovData[13]=13;
- if (gMC->CurrentVolID(copy) == gMC->VolId("GAP "))
- ckovData[13]=13;
-
- if (gMC->CurrentVolID(copy) == gMC->VolId("SRIC"))
- ckovData[13]=15;
-
- // CsI inefficiency
- if (gMC->CurrentVolID(copy) == gMC->VolId("CSI ")) {
- ckovData[13]=16;
- }
- gMC->StopTrack();
- AddCerenkov(gAlice->CurrentTrack(),vol,ckovData);
- //printf("Added One (3)!\n");
- //printf("Added cerenkov %d\n",fCkovNumber);
- } //absorption question
-
-
- // Photon goes out of tracking scope
- else if (procs[i] == kPStop) { //is it below energy treshold?
- ckovData[13]=21;
- gMC->StopTrack();
- AddCerenkov(gAlice->CurrentTrack(),vol,ckovData);
- //printf("Added One (4)!\n");
- } // energy treshold question
- } //number of mechanisms cycle
- /**********************End of evaluation************************/
- } //freon production question
- } //energy interval question
- //}//inside the proximity gap question
- } //cerenkov photon question
-
- /**************************************End of Production Parameters Storing*********************/
-
-
- /*******************************Treat photons that hit the CsI (Ckovs and Feedbacks)************/
-
- if (gMC->TrackPid() == 50000050 || gMC->TrackPid() == 50000051) {
- //printf("Cerenkov\n");
-
- //if (gMC->TrackPid() == 50000051)
- //printf("Tracking a feedback\n");
-
- if (gMC->VolId("CSI ")==gMC->CurrentVolID(copy))
- {
- //printf("Current volume (should be CSI) (2): %s\n",gMC->CurrentVolName());
- //printf("VolId: %d, CurrentVolID: %d\n",gMC->VolId("CSI "),gMC->CurrentVolID(copy));
- //printf("Got in CSI\n");
- //printf("Tracking a %d\n",gMC->TrackPid());
- if (gMC->Edep() > 0.){
- gMC->TrackPosition(position);
- gMC->TrackMomentum(momentum);
- pos[0]=position(0);
- pos[1]=position(1);
- pos[2]=position(2);
- mom[0]=momentum(0);
- mom[1]=momentum(1);
- mom[2]=momentum(2);
- mom[3]=momentum(3);
- Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
- Double_t rt = TMath::Sqrt(tc);
- theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
- phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
-
- gMC->CurrentVolOffID(2,copy);
- vol[0]=copy;
- idvol=vol[0]-1;
-
-
- gMC->Gmtod(pos,localPos,1);
-
- //Chamber(idvol).GlobaltoLocal(pos,localPos);
-
- gMC->Gmtod(mom,localMom,2);
-
- //Chamber(idvol).GlobaltoLocal(mom,localMom);
-
- gMC->CurrentVolOffID(2,copy);
- vol[0]=copy;
- idvol=vol[0]-1;
-
- //Int_t sector=((AliRICHChamber*) (*fChambers)[idvol])
- //->Sector(localPos[0], localPos[2]);
- //printf("Sector:%d\n",sector);
-
- /*if (gMC->TrackPid() == 50000051){
- fFeedbacks++;
- printf("Feedbacks:%d\n",fFeedbacks);
- }*/
-
- //PH ((AliRICHChamber*) (*fChambers)[idvol])
- ((AliRICHChamber*)fChambers->At(idvol))
- ->SigGenInit(localPos[0], localPos[2], localPos[1]);
- if(idvol<kNCH) {
- ckovData[0] = gMC->TrackPid(); // particle type
- ckovData[1] = pos[0]; // X-position for hit
- ckovData[2] = pos[1]; // Y-position for hit
- ckovData[3] = pos[2]; // Z-position for hit
- ckovData[4] = theta; // theta angle of incidence
- ckovData[5] = phi; // phi angle of incidence
- ckovData[8] = (Float_t) fNSDigits; // first sdigit
- ckovData[9] = -1; // last pad hit
- ckovData[13] = 4; // photon was detected
- ckovData[14] = mom[0];
- ckovData[15] = mom[1];
- ckovData[16] = mom[2];
-
- destep = gMC->Edep();
- gMC->SetMaxStep(kBig);
- cherenkovLoss += destep;
- ckovData[7]=cherenkovLoss;
-
- nPads = Hits2SDigits(localPos[0],localPos[2],cherenkovLoss,idvol,kCerenkov);
-
- if (fNSDigits > (Int_t)ckovData[8]) {
- ckovData[8]= ckovData[8]+1;
- ckovData[9]= (Float_t) fNSDigits;
- }
-
- //printf("Cerenkov loss: %f\n", cherenkovLoss);
-
- ckovData[17] = nPads;
- //printf("nPads:%d",nPads);
-
- //TClonesArray *Hits = RICH->Hits();
- AliRICHHit *mipHit = (AliRICHHit*) (fHits->UncheckedAt(0));
- if (mipHit)
- {
- mom[0] = current->Px();
- mom[1] = current->Py();
- mom[2] = current->Pz();
- Float_t mipPx = mipHit->MomX();
- Float_t mipPy = mipHit->MomY();
- Float_t mipPz = mipHit->MomZ();
-
- Float_t r = mom[0]*mom[0] + mom[1]*mom[1] + mom[2]*mom[2];
- Float_t rt = TMath::Sqrt(r);
- Float_t mipR = mipPx*mipPx + mipPy*mipPy + mipPz*mipPz;
- Float_t mipRt = TMath::Sqrt(mipR);
- if ((rt*mipRt) > 0)
- {
- coscerenkov = (mom[0]*mipPx + mom[1]*mipPy + mom[2]*mipPz)/(rt*mipRt);
- }
- else
- {
- coscerenkov = 0;
- }
- Float_t cherenkov = TMath::ACos(coscerenkov);
- ckovData[18]=cherenkov;
- }
- //if (sector != -1)
- //{
- AddHit(gAlice->CurrentTrack(),vol,ckovData);
- AddCerenkov(gAlice->CurrentTrack(),vol,ckovData);
- //printf("Added One (5)!\n");
- //}
- }
- }
- }
- }
-
- /***********************************************End of photon hits*********************************************/
-
-
- /**********************************************Charged particles treatment*************************************/
-
- else if (gMC->TrackCharge())
- //else if (1 == 1)
- {
-//If MIP
- /*if (gMC->IsTrackEntering())
- {
- hits[13]=20;//is track entering?
- }*/
- if (gMC->VolId("FRE1")==gMC->CurrentVolID(copy) || gMC->VolId("FRE2")==gMC->CurrentVolID(copy))
- {
- gMC->TrackMomentum(momentum);
- mom[0]=momentum(0);
- mom[1]=momentum(1);
- mom[2]=momentum(2);
- mom[3]=momentum(3);
- hits [19] = mom[0];
- hits [20] = mom[1];
- hits [21] = mom[2];
- fFreonProd=1;
- }
-
- if (gMC->VolId("GAP ")== gMC->CurrentVolID(copy)) {
-// Get current particle id (ipart), track position (pos) and momentum (mom)
-
- gMC->CurrentVolOffID(3,copy);
- vol[0]=copy;
- idvol=vol[0]-1;
-
- //Int_t sector=((AliRICHChamber*) (*fChambers)[idvol])
- //->Sector(localPos[0], localPos[2]);
- //printf("Sector:%d\n",sector);
-
- gMC->TrackPosition(position);
- gMC->TrackMomentum(momentum);
- pos[0]=position(0);
- pos[1]=position(1);
- pos[2]=position(2);
- mom[0]=momentum(0);
- mom[1]=momentum(1);
- mom[2]=momentum(2);
- mom[3]=momentum(3);
-
- gMC->Gmtod(pos,localPos,1);
-
- //Chamber(idvol).GlobaltoLocal(pos,localPos);
-
- gMC->Gmtod(mom,localMom,2);
-
- //Chamber(idvol).GlobaltoLocal(mom,localMom);
-
- ipart = gMC->TrackPid();
- //
- // momentum loss and steplength in last step
- destep = gMC->Edep();
- step = gMC->TrackStep();
-
- //
- // record hits when track enters ...
- if( gMC->IsTrackEntering()) {
-// gMC->SetMaxStep(fMaxStepGas);
- Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
- Double_t rt = TMath::Sqrt(tc);
- theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
- phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
-
-
- Double_t localTc = localMom[0]*localMom[0]+localMom[2]*localMom[2];
- Double_t localRt = TMath::Sqrt(localTc);
- localTheta = Float_t(TMath::ATan2(localRt,Double_t(localMom[1])))*kRaddeg;
- localPhi = Float_t(TMath::ATan2(Double_t(localMom[2]),Double_t(localMom[0])))*kRaddeg;
-
- hits[0] = Float_t(ipart); // particle type
- hits[1] = localPos[0]; // X-position for hit
- hits[2] = localPos[1]; // Y-position for hit
- hits[3] = localPos[2]; // Z-position for hit
- hits[4] = localTheta; // theta angle of incidence
- hits[5] = localPhi; // phi angle of incidence
- hits[8] = (Float_t) fNSDigits; // first sdigit
- hits[9] = -1; // last pad hit
- hits[13] = fFreonProd; // did id hit the freon?
- hits[14] = mom[0];
- hits[15] = mom[1];
- hits[16] = mom[2];
- hits[18] = 0; // dummy cerenkov angle
-
- tlength = 0;
- eloss = 0;
- fFreonProd = 0;
-
- Chamber(idvol).LocaltoGlobal(localPos,hits+1);
-
-
- //To make chamber coordinates x-y had to pass localPos[0], localPos[2]
- xhit = localPos[0];
- yhit = localPos[2];
- // Only if not trigger chamber
- if(idvol<kNCH) {
- //
- // Initialize hit position (cursor) in the segmentation model
- //PH ((AliRICHChamber*) (*fChambers)[idvol])
- ((AliRICHChamber*)fChambers->At(idvol))
- ->SigGenInit(localPos[0], localPos[2], localPos[1]);
- }
- }
-
- //
- // Calculate the charge induced on a pad (disintegration) in case
- //
- // Mip left chamber ...
- if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
- gMC->SetMaxStep(kBig);
- eloss += destep;
- tlength += step;
-
-
- // Only if not trigger chamber
- if(idvol<kNCH) {
- if (eloss > 0)
- {
- if(gMC->TrackPid() == kNeutron)
- printf("\n\n\n\n\n Neutron Making Pad Hit!!! \n\n\n\n");
- nPads = Hits2SDigits(xhit,yhit,eloss,idvol,kMip);
- hits[17] = nPads;
- //printf("nPads:%d",nPads);
- }
- }
-
- hits[6]=tlength;
- hits[7]=eloss;
- if (fNSDigits > (Int_t)hits[8]) {
- hits[8]= hits[8]+1;
- hits[9]= (Float_t) fNSDigits;
- }
-
- //if(sector !=-1)
- new(lhits[fNhits++]) AliRICHHit(fIshunt,gAlice->CurrentTrack(),vol,hits);
- eloss = 0;
- //
- // Check additional signal generation conditions
- // defined by the segmentation
- // model (boundary crossing conditions)
- } else if
- //PH (((AliRICHChamber*) (*fChambers)[idvol])
- (((AliRICHChamber*)fChambers->At(idvol))
- ->SigGenCond(localPos[0], localPos[2], localPos[1]))
- {
- //PH ((AliRICHChamber*) (*fChambers)[idvol])
- ((AliRICHChamber*)fChambers->At(idvol))
- ->SigGenInit(localPos[0], localPos[2], localPos[1]);
- if (eloss > 0)
- {
- if(gMC->TrackPid() == kNeutron)
- printf("\n\n\n\n\n Neutron Making Pad Hit!!! \n\n\n\n");
- nPads = Hits2SDigits(xhit,yhit,eloss,idvol,kMip);
- hits[17] = nPads;
- //printf("Npads:%d",NPads);
- }
- xhit = localPos[0];
- yhit = localPos[2];
- eloss = destep;
- tlength += step ;
- //
- // nothing special happened, add up energy loss
- } else {
- eloss += destep;
- tlength += step ;
- }
- }
- }
- /*************************************************End of MIP treatment**************************************/
- //}
-}//void AliRICH::StepManager()
-
-void AliRICH::FindClusters(Int_t nev,Int_t lastEntry)
-{
-
-//
-// Loop on chambers and on cathode planes
-//
+//______________________________________________________________________________
+void AliRICH::FindClusters(Int_t nev /*kir,Int_t lastEntry*/)
+{// Loop on chambers and on cathode planes
for (Int_t icat=1;icat<2;icat++) {
gAlice->ResetDigits();
gAlice->TreeD()->GetEvent(0);
TClonesArray *fRch;
for (int i=0;i<kNCH;i++) {
fRch=RawClustAddress(i);
- int nraw=fRch->GetEntriesFast();
- printf ("Chamber %d, raw clusters %d\n",i,nraw);
+ fRch->GetEntriesFast();
}
ResetRawClusters();
char hname[30];
sprintf(hname,"TreeR%d",nev);
gAlice->TreeR()->Write(hname,kOverwrite,0);
- gAlice->TreeR()->Reset();
-
- //gObjectTable->Print();
-}
-
-AliRICHSDigit* AliRICH::FirstPad(AliRICHHit* hit,TClonesArray *clusters )
-{
-//
- // Initialise the pad iterator
- // Return the address of the first sdigit for hit
+ gAlice->TreeR()->Reset();
+}//void AliRICH::FindClusters(Int_t nev)
+//______________________________________________________________________________
+AliRICHSDigit* AliRICH::FirstPad(AliRICHhit* hit,TClonesArray *clusters )
+{// Initialise the pad iterator Return the address of the first sdigit for hit
TClonesArray *theClusters = clusters;
Int_t nclust = theClusters->GetEntriesFast();
if (nclust && hit->PHlast() > 0) {
}
}
-
+//______________________________________________________________________________
AliRICHSDigit* AliRICH::NextPad(TClonesArray *clusters)
-{
-
- // Iterates over pads
+{// Iterates over pads
sCurIterPad++;
if (sCurIterPad <= sMaxIterPad) {
}
}
-AliRICH& AliRICH::operator=(const AliRICH& rhs)
-{
-// Assignment operator
- return *this;
-
-}
void AliRICH::DiagnosticsFE(Int_t evNumber1,Int_t evNumber2)
{
Int_t nparticles = gAlice->GetEvent(nev);
- printf ("Event number : %d\n",nev);
- printf ("Number of particles: %d\n",nparticles);
if (nev < evNumber1) continue;
if (nparticles <= 0) return;
AliRICH *pRICH = (AliRICH *) gAlice->GetDetector("RICH");
- TTree *treeH = gAlice->TreeH();
+ TTree *treeH = TreeH();
Int_t ntracks =(Int_t) treeH->GetEntries();
// Start loop on tracks in the hits containers
gAlice->ResetHits();
treeH->GetEvent(track);
- for(AliRICHHit* mHit=(AliRICHHit*)pRICH->FirstHit(-1);
+ for(AliRICHhit* mHit=(AliRICHhit*)pRICH->FirstHit(-1);
mHit;
- mHit=(AliRICHHit*)pRICH->NextHit())
+ mHit=(AliRICHhit*)pRICH->NextHit())
{
//Int_t nch = mHit->fChamber; // chamber number
//Float_t x = mHit->X(); // x-pos of hit
//if (nch == 3)
//{
- //printf("Particle type: %d\n",current->GetPdgCode());
if (TMath::Abs(particle) < 50000051)
{
//if (TMath::Abs(particle) == 50000050 || TMath::Abs(particle) == 2112)
if (TMath::Abs(particle) < 50000000)
{
production->Fill(current->Vz(),R,(float) 1);
- //printf("Adding %d at %f\n",particle,R);
}
//mip->Fill(x,y,(float) 1);
}
if (TMath::Abs(particle)==211 || TMath::Abs(particle)==111)
{
pionspectra1->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
- //printf ("fParticle: %d, PDG code:%d\n",particle,current->GetPdgCode());
if (current->Vx()>5 && current->Vy()>5 && current->Vz()>5)
pionspectra2->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
if (R>250 && R<450)
{
pionspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
- //printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\R:%f\n\n\n\n\n\n\n\n\n",R);
}
- //printf("Pion mass: %e\n",current->GetCalcMass());
pion +=1;
if (TMath::Abs(particle)==211)
{
protonspectra2->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
if (R>250 && R<450)
protonspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
- //printf("\n\n\n\n\n\n\nProton mass: %e\n\n\n\n\n\n\n\n\n",current->GetCalcMass());
proton +=1;
}
if (TMath::Abs(particle)==321 || TMath::Abs(particle)==130 || TMath::Abs(particle)==310
kaonspectra2->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
if (R>250 && R<450)
kaonspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
- //printf("Kaon mass: %e\n",current->GetCalcMass());
kaon +=1;
if (TMath::Abs(particle)==321)
{
electronspectra2->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
if (R>250 && R<450)
electronspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
- //printf("Electron mass: %e\n",current->GetCalcMass());
if (particle == 11)
electron +=1;
if (particle == -11)
muonspectra2->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
if (R>250 && R<450)
muonspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
- //printf("Muon mass: %e\n",current->GetCalcMass());
muon +=1;
}
if (TMath::Abs(particle)==2112)
if (R>250 && R<450)
{
neutronspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
- //printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\R:%f\n\n\n\n\n\n\n\n\n",R);
}
- //printf("Neutron mass: %e\n",current->GetCalcMass());
neutron +=1;
}
if(TMath::Abs(particle)==211 || TMath::Abs(particle)==2212 || TMath::Abs(particle)==321)
chargedspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
}
}
- //printf("Hits:%d\n",hit);
- //printf ("Chamber number:%d x:%f y:%f\n",nch,x,y);
// Fill the histograms
//Nh1+=nhits;
//h->Fill(x,y,(float) 1);
printf("\nEnd of analysis\n");
-}
-
-//_________________________________________________________________________________________________
-
-
+}//void AliRICH::DiagnosticsFE(Int_t evNumber1,Int_t evNumber2)
+//______________________________________________________________________________
void AliRICH::DiagnosticsSE(Int_t diaglevel,Int_t evNumber1,Int_t evNumber2)
{
// Get pointers to RICH detector and Hits containers
- TTree *TH = gAlice->TreeH();
+ TTree *TH = TreeH();
Stat_t ntracks = TH->GetEntries();
// Start loop on tracks in the hits containers
Int_t nhits = pRICH->Hits()->GetEntriesFast();
if (nhits) Nh+=nhits;
printf("Hits : %d\n",nhits);
- for(AliRICHHit* mHit=(AliRICHHit*)pRICH->FirstHit(-1);
+ for(AliRICHhit* mHit=(AliRICHhit*)pRICH->FirstHit(-1);
mHit;
- mHit=(AliRICHHit*)pRICH->NextHit())
+ mHit=(AliRICHhit*)pRICH->NextHit())
{
Int_t nch = mHit->Chamber(); // chamber number
trackglob[0] = mHit->X(); // x-pos of hit
if (TMath::Abs(particle) < 10000000)
{
PTfinal=TMath::Sqrt(px*px + py*py);
- //printf("PTfinal 0: %f\n",PTfinal);
}
chamber = &(pRICH->Chamber(nch-1));
- //printf("Nch:%d\n",nch);
chamber->GlobaltoLocal(trackglob,trackloc);
hitsX->Fill(x,(float) 1);
hitsY->Fill(y,(float) 1);
- //printf("Particle:%9d\n",particle);
TParticle *current = (TParticle*)gAlice->Particle(index);
//printf("Particle type: %d\n",sizeoff(Particles));
hitsTheta->Fill(theta,(float) 1);
//hitsPhi->Fill(phi,(float) 1);
//if (pRICH->GetDebugLevel() == -1)
- //printf("Theta:%f, Phi:%f\n",theta,phi);
-
- //printf("Debug Level:%d\n",pRICH->GetDebugLevel());
if (current->GetPdgCode() < 10000000)
{
//printf ("Cerenkov hit number %d/%d, X:%d, Y:%d\n",hit,ncerenkovs,cx,cy);
//TParticle *MIP = (TParticle*)gAlice->Particle(cmother);
- AliRICHHit* mipHit = (AliRICHHit*) pRICH->Hits()->UncheckedAt(0);
+ AliRICHhit* mipHit = (AliRICHhit*) pRICH->Hits()->UncheckedAt(0);
mom[0] = current->Px();
mom[1] = current->Py();
mom[2] = current->Pz();
//printf("The total number of pads which give a signal: %d %d\n",Nh,Nh1);
printf("\nEnd of analysis\n");
printf("**********************************\n");
-}
-
-////////////////////////////////////////////////////////////////////////
+}//void AliRICH::DiagnosticsSE(Int_t diaglevel,Int_t evNumber1,Int_t evNumber2)
+//______________________________________________________________________________
void AliRICH::MakeBranchInTreeD(TTree *treeD, const char *file)
-{
- //
- // Create TreeD branches for the RICH.
- //
+{// Create TreeD branches for the RICH.
+ if(GetDebug())Info("MakeBranchInTreeD","Start.");
const Int_t kBufferSize = 4000;
char branchname[30];
for (Int_t i=0; i<kNCH ;i++) {
sprintf(branchname,"%sDigits%d",GetName(),i+1);
if (fDchambers && treeD) {
- MakeBranchInTree(treeD,
- branchname, &((*fDchambers)[i]), kBufferSize, file);
+ MakeBranchInTree(treeD,branchname, &((*fDchambers)[i]), kBufferSize, file);
// printf("Making Branch %s for digits in chamber %d\n",branchname,i+1);
}
}
}
-////////////////////////////////////////////////////////////////////////
+//______________________________________________________________________________
+void AliRICH::MakeBranch(Option_t* option)
+{//Create Tree branches for the RICH.
+ if(GetDebug())Info("MakeBranch","Start with option= %s.",option);
+
+ const Int_t kBufferSize = 4000;
+ char branchname[20];
+
+
+ const char *cH = strstr(option,"H");
+ const char *cD = strstr(option,"D");
+ const char *cR = strstr(option,"R");
+ const char *cS = strstr(option,"S");
+
+
+ if(cH&&TreeH()){
+ if(!fHits) fHits=new TClonesArray("AliRICHhit",1000 );
+ if(!fCerenkovs) fCerenkovs = new TClonesArray("AliRICHCerenkov",1000);
+ MakeBranchInTree(TreeH(),"RICHCerenkov", &fCerenkovs, kBufferSize, 0) ;
+
+ //kir if(!fSDigits) fSDigits = new TClonesArray("AliRICHdigit",100000);
+ //kir MakeBranchInTree(TreeH(),"RICHSDigits", &fSDigits, kBufferSize, 0) ;
+ }
+ AliDetector::MakeBranch(option);//this is after cH because we need to guarantee that fHits array is created
+
+ if(cS&&fLoader->TreeS()){
+ if(!fSDigits) fSDigits=new TClonesArray("AliRICHdigit",100000);
+ MakeBranchInTree(fLoader->TreeS(),"RICH",&fSDigits,kBufferSize,0) ;
+ }
+
+ int i;
+ if (cD&&fLoader->TreeD()){
+ if(!fDchambers){
+ fDchambers=new TObjArray(kNCH); // one branch for digits per chamber
+ for(i=0;i<kNCH;i++){
+ fDchambers->AddAt(new TClonesArray("AliRICHDigit",10000), i);
+ }
+ }
+ for (i=0; i<kNCH ;i++)
+ {
+ sprintf(branchname,"%sDigits%d",GetName(),i+1);
+ MakeBranchInTree(fLoader->TreeD(),branchname, &((*fDchambers)[i]), kBufferSize, 0);
+ }
+ }
+
+ if (cR&&gAlice->TreeR()){//one branch for raw clusters per chamber
+ Int_t i;
+ if (fRawClusters == 0x0 )
+ {
+ fRawClusters = new TObjArray(kNCH);
+ for (i=0; i<kNCH ;i++)
+ {
+ fRawClusters->AddAt(new TClonesArray("AliRICHRawCluster",10000), i);
+ }
+ }
+
+ if (fRecHits1D == 0x0)
+ {
+ fRecHits1D = new TObjArray(kNCH);
+ for (i=0; i<kNCH ;i++)
+ {
+ fRecHits1D->AddAt(new TClonesArray("AliRICHRecHit1D",1000), i);
+ }
+ }
+
+ if (fRecHits3D == 0x0)
+ {
+ fRecHits3D = new TObjArray(kNCH);
+ for (i=0; i<kNCH ;i++)
+ {
+ fRecHits3D->AddAt(new TClonesArray("AliRICHRecHit3D",1000), i);
+ }
+ }
+
+ for (i=0; i<kNCH ;i++){
+ sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
+ MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRawClusters)[i]), kBufferSize, 0);
+ sprintf(branchname,"%sRecHits1D%d",GetName(),i+1);
+ MakeBranchInTree(fLoader->TreeR(),branchname, &((*fRecHits1D)[i]), kBufferSize, 0);
+ sprintf(branchname,"%sRecHits3D%d",GetName(),i+1);
+ MakeBranchInTree(fLoader->TreeR(),branchname, &((*fRecHits3D)[i]), kBufferSize, 0);
+ }
+ }//if (cR && gAlice->TreeR())
+ if(GetDebug())Info("MakeBranch","Stop.");
+}
+//______________________________________________________________________________
+void AliRICH::SetTreeAddress()
+{//Set branch address for the Hits and Digits Tree.
+ if(GetDebug())Info("SetTreeAddress","Start.");
+
+ char branchname[20];
+ Int_t i;
+
+
+ TBranch *branch;
+ TTree *treeH = fLoader->TreeH();
+ TTree *treeD = fLoader->TreeD();
+ TTree *treeR = fLoader->TreeR();
+ TTree *treeS = fLoader->TreeS();
+
+ if(treeH){
+ if(GetDebug())Info("SetTreeAddress","tree H is requested.");
+ if(fHits==0x0) fHits=new TClonesArray("AliRICHhit",1000);
+
+ branch = treeH->GetBranch("RICHCerenkov");
+ if(branch){
+ if (fCerenkovs == 0x0) fCerenkovs = new TClonesArray("AliRICHCerenkov",1000);
+ branch->SetAddress(&fCerenkovs);
+ }
+
+//kir branch = treeH->GetBranch("RICHSDigits");
+//kir if (branch)
+//kir {
+//kir if (fSDigits == 0x0) fSDigits = new TClonesArray("AliRICHdigit",100000);
+//kir branch->SetAddress(&fSDigits);
+//kir }
+ }//if(treeH)
+
+ //this is after TreeH because we need to guarantee that fHits array is created
+ AliDetector::SetTreeAddress();
+
+ if(treeS){
+ if(GetDebug())Info("SetTreeAddress","tree S is requested.");
+ branch = treeS->GetBranch("RICH");
+ if(branch){
+ if(!fSDigits) fSDigits=new TClonesArray("AliRICHdigit",100000);
+ branch->SetAddress(&fSDigits);
+ }
+ }
+
+
+ if(treeD){
+ if(GetDebug())Info("SetTreeAddress","tree D is requested.");
+
+ if (fDchambers == 0x0)
+ {
+ fDchambers = new TObjArray(kNCH);
+ for (i=0; i<kNCH ;i++)
+ {
+ fDchambers->AddAt(new TClonesArray("AliRICHDigit",10000), i);
+ }
+ }
+
+ for (i=0; i<kNCH; i++) {
+ sprintf(branchname,"%sDigits%d",GetName(),i+1);
+ if (fDchambers) {
+ branch = treeD->GetBranch(branchname);
+ if (branch) branch->SetAddress(&((*fDchambers)[i]));
+ }
+ }
+ }
+
+ if(treeR){
+ if(GetDebug())Info("SetTreeAddress","tree R is requested.");
+
+ if (fRawClusters == 0x0 )
+ {
+ fRawClusters = new TObjArray(kNCH);
+ for (i=0; i<kNCH ;i++)
+ {
+ fRawClusters->AddAt(new TClonesArray("AliRICHRawCluster",10000), i);
+ }
+ }
+
+ if (fRecHits1D == 0x0)
+ {
+ fRecHits1D = new TObjArray(kNCH);
+ for (i=0; i<kNCH ;i++)
+ {
+ fRecHits1D->AddAt(new TClonesArray("AliRICHRecHit1D",1000), i);
+ }
+ }
+
+ if (fRecHits3D == 0x0)
+ {
+ fRecHits3D = new TObjArray(kNCH);
+ for (i=0; i<kNCH ;i++)
+ {
+ fRecHits3D->AddAt(new TClonesArray("AliRICHRecHit3D",1000), i);
+ }
+ }
+
+ for (i=0; i<kNCH; i++) {
+ sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
+ if (fRawClusters) {
+ branch = treeR->GetBranch(branchname);
+ if (branch) branch->SetAddress(&((*fRawClusters)[i]));
+ }
+ }
+
+ for (i=0; i<kNCH; i++) {
+ sprintf(branchname,"%sRecHits1D%d",GetName(),i+1);
+ if (fRecHits1D) {
+ branch = treeR->GetBranch(branchname);
+ if (branch) branch->SetAddress(&((*fRecHits1D)[i]));
+ }
+ }
+
+ for (i=0; i<kNCH; i++) {
+ sprintf(branchname,"%sRecHits3D%d",GetName(),i+1);
+ if (fRecHits3D) {
+ branch = treeR->GetBranch(branchname);
+ if (branch) branch->SetAddress(&((*fRecHits3D)[i]));
+ }
+ }
+
+ }//if(treeR)
+ if(GetDebug())Info("SetTreeAddress","Stop.");
+}//void AliRICH::SetTreeAddress()
+//______________________________________________________________________________
+void AliRICH::Print(Option_t *option)const
+{
+ TObject::Print(option);
+ fpParam->Dump();
+ Chambers()->Print(option);
+}//void AliRICH::Print(Option_t *option)const
+//______________________________________________________________________________
+void AliRICH::CreateGeometry()
+{//Creates detailed geometry simulation (currently GEANT volumes tree)
+ if(GetDebug())Info("CreateGeometry","Start.");
+//???????? to be removed to AliRICHParam?
+ fpParam->RadiatorToPads(fpParam->FreonThickness()/2+fpParam->QuartzThickness()+fpParam->GapThickness());
+
+//Opaque quartz thickness
+ Float_t oqua_thickness = .5;
+//CsI dimensions
+ Float_t csi_width =fpParam->Nx()*fpParam->PadX()+fpParam->DeadZone();
+ Float_t csi_length=fpParam->Ny()*fpParam->PadY()+2*fpParam->DeadZone();
+
+ Int_t *idtmed = fIdtmed->GetArray()-999;
+
+ Int_t i;
+ Float_t zs;
+ Int_t idrotm[1099];
+ Float_t par[3];
+
+//External aluminium box
+ par[0]=68.8;par[1]=13;par[2]=70.86;//Original Settings
+ gMC->Gsvolu("RICH", "BOX ", idtmed[1009], par, 3);
+//Air
+ par[0]=66.3; par[1] = 13; par[2] = 68.35; //Original Settings
+ gMC->Gsvolu("SRIC", "BOX ", idtmed[1000], par, 3);
+//Air 2 (cutting the lower part of the box)
+ par[0]=1.25; par[1] = 3; par[2] = 70.86; //Original Settings
+ gMC->Gsvolu("AIR2", "BOX ", idtmed[1000], par, 3);
+//Air 3 (cutting the lower part of the box)
+ par[0]=66.3; par[1] = 3; par[2] = 1.2505; //Original Settings
+ gMC->Gsvolu("AIR3", "BOX ", idtmed[1000], par, 3);
+//Honeycomb
+ par[0]=66.3;par[1]=0.188; par[2] = 68.35; //Original Settings
+ gMC->Gsvolu("HONE", "BOX ", idtmed[1001], par, 3);
+//Aluminium sheet
+ par[0]=66.3;par[1]=0.025;par[2]=68.35; //Original Settings
+ //par[0] = 66.5; par[1] = .025; par[2] = 63.1;
+ gMC->Gsvolu("ALUM", "BOX ", idtmed[1009], par, 3);
+//Quartz
+ par[0]=fpParam->QuartzWidth()/2;par[1]=fpParam->QuartzThickness()/2;par[2]=fpParam->QuartzLength()/2;
+ gMC->Gsvolu("QUAR", "BOX ", idtmed[1002], par, 3);
+//Spacers (cylinders)
+ par[0]=0.;par[1]=.5;par[2]=fpParam->FreonThickness()/2;
+ gMC->Gsvolu("SPAC", "TUBE", idtmed[1002], par, 3);
+//Feet (freon slabs supports)
+ par[0] = .7; par[1] = .3; par[2] = 1.9;
+ gMC->Gsvolu("FOOT", "BOX", idtmed[1009], par, 3);
+//Opaque quartz
+ par[0]=fpParam->QuartzWidth()/2;par[1]= .2;par[2]=fpParam->QuartzLength()/2;
+ gMC->Gsvolu("OQUA", "BOX ", idtmed[1007], par, 3);
+//Frame of opaque quartz
+ par[0]=fpParam->OuterFreonWidth()/2;par[1]=fpParam->FreonThickness()/2;par[2]=fpParam->OuterFreonLength()/2;
+ gMC->Gsvolu("OQF1", "BOX ", idtmed[1007], par, 3);
+ par[0]=fpParam->InnerFreonWidth()/2;par[1]=fpParam->FreonThickness()/2;par[2]=fpParam->InnerFreonLength()/2;
+ gMC->Gsvolu("OQF2", "BOX ", idtmed[1007], par, 3);
+//Freon
+ par[0]=fpParam->OuterFreonWidth()/2 - oqua_thickness;
+ par[1]=fpParam->FreonThickness()/2;
+ par[2]=fpParam->OuterFreonLength()/2 - 2*oqua_thickness;
+ gMC->Gsvolu("FRE1", "BOX ", idtmed[1003], par, 3);
+
+ par[0]=fpParam->InnerFreonWidth()/2 - oqua_thickness;
+ par[1]=fpParam->FreonThickness()/2;
+ par[2]=fpParam->InnerFreonLength()/2 - 2*oqua_thickness;
+ gMC->Gsvolu("FRE2", "BOX ", idtmed[1003], par, 3);
+//Methane
+ par[0]=csi_width/2;par[1]=fpParam->GapThickness()/2;par[2]=csi_length/2;
+ gMC->Gsvolu("META", "BOX ", idtmed[1004], par, 3);
+//Methane gap
+ par[0]=csi_width/2;par[1]=fpParam->ProximityGapThickness()/2;par[2] = csi_length/2;
+ gMC->Gsvolu("GAP ", "BOX ", idtmed[1008], par, 3);
+//CsI photocathode
+ par[0]=csi_width/2;par[1]=.25;par[2]=csi_length/2;
+ gMC->Gsvolu("CSI ", "BOX ", idtmed[1005], par, 3);
+//Anode grid
+ par[0] = 0.;par[1] = .001;par[2] = 20.;
+ gMC->Gsvolu("GRID", "TUBE", idtmed[1006], par, 3);
+
+//Wire supports
+//Bar of metal
+ par[0]=csi_width/2;par[1]=1.05;par[2]=1.05;
+ gMC->Gsvolu("WSMe", "BOX ", idtmed[1009], par, 3);
+//Ceramic pick up (base)
+ par[0]=csi_width/2;par[1]= .25;par[2]=1.05;
+ gMC->Gsvolu("WSG1", "BOX ", idtmed[1010], par, 3);
+//Ceramic pick up (head)
+ par[0] = csi_width/2;par[1] = .1;par[2] = .1;
+ gMC->Gsvolu("WSG2", "BOX ", idtmed[1010], par, 3);
+
+//Aluminium supports for methane and CsI
+//Short bar
+ par[0]=csi_width/2;par[1]=fpParam->GapThickness()/2 + .25; par[2] = (68.35 - csi_length/2)/2;
+ gMC->Gsvolu("SMSH", "BOX", idtmed[1009], par, 3);
+//Long bar
+ par[0]=(66.3 - csi_width/2)/2;par[1]=fpParam->GapThickness()/2+.25;par[2]=csi_length/2+68.35-csi_length/2;
+ gMC->Gsvolu("SMLG", "BOX", idtmed[1009], par, 3);
+
+//Aluminium supports for freon
+//Short bar
+ par[0] = fpParam->QuartzWidth()/2; par[1] = .3; par[2] = (68.35 - fpParam->QuartzLength()/2)/2;
+ gMC->Gsvolu("SFSH", "BOX", idtmed[1009], par, 3);
+//Long bar
+ par[0] = (66.3 - fpParam->QuartzWidth()/2)/2; par[1] = .3;
+ par[2] = fpParam->QuartzLength()/2 + 68.35 - fpParam->QuartzLength()/2;
+ gMC->Gsvolu("SFLG", "BOX", idtmed[1009], par, 3);
+//PCB backplane
+ par[0] = csi_width/2;par[1] = .25; par[2] = csi_length/4 -.5025;
+ gMC->Gsvolu("PCB ", "BOX", idtmed[1011], par, 3);
+
+//Backplane supports
+//Aluminium slab
+ par[0] = 33.15;par[1] = 2;par[2] = 21.65;
+ gMC->Gsvolu("BACK", "BOX", idtmed[1009], par, 3);
+//Big hole
+ par[0] = 9.05; par[1] = 2; par[2] = 4.4625;
+ gMC->Gsvolu("BKHL", "BOX", idtmed[1000], par, 3);
+//Small hole
+ par[0] = 5.7;par[1] = 2;par[2] = 4.4625;
+ gMC->Gsvolu("BKHS", "BOX", idtmed[1000], par, 3);
+//Place holes inside backplane support
+ gMC->Gspos("BKHS", 1, "BACK", .8 + 5.7,0., .6 + 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHS", 2, "BACK", -.8 - 5.7,0., .6 + 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHS", 3, "BACK", .8 + 5.7,0., -.6 - 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHS", 4, "BACK", -.8 - 5.7,0., -.6 - 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHS", 5, "BACK", .8 + 5.7,0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHS", 6, "BACK", -.8 - 5.7,0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHS", 7, "BACK", .8 + 5.7,0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHS", 8, "BACK", -.8 - 5.7,0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHL", 1, "BACK", .8 + 11.4 + 1.6 + 9.05, 0., .6 + 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHL", 2, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., .6 + 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHL", 3, "BACK", .8 + 11.4 + 1.6 + 9.05, 0., -.6 - 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHL", 4, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., -.6 - 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHL", 5, "BACK", .8 + 11.4+ 1.6 + 9.05, 0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHL", 6, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHL", 7, "BACK", .8 + 11.4 + 1.6 + 9.05, 0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
+ gMC->Gspos("BKHL", 8, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
+//Place material inside RICH
+ gMC->Gspos("SRIC", 1, "RICH", 0.,0., 0., 0, "ONLY");
+ gMC->Gspos("AIR2", 1, "RICH", 66.3 + 1.2505, 1.276-fpParam->GapThickness()/2-fpParam->QuartzThickness()-fpParam->FreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, 0., 0, "ONLY");
+ gMC->Gspos("AIR2", 2, "RICH", -66.3 - 1.2505,1.276-fpParam->GapThickness()/2-fpParam->QuartzThickness()-fpParam->FreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, 0., 0, "ONLY");
+ gMC->Gspos("AIR3", 1, "RICH", 0., 1.276-fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, -68.35 - 1.25, 0, "ONLY");
+ gMC->Gspos("AIR3", 2, "RICH", 0., 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, 68.35 + 1.25, 0, "ONLY");
+ gMC->Gspos("ALUM", 1, "SRIC", 0., 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .6 - .05 - .376 -.025, 0., 0, "ONLY");
+ gMC->Gspos("HONE", 1, "SRIC", 0., 1.276- fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .6 - .05 - .188, 0., 0, "ONLY");
+ gMC->Gspos("ALUM", 2, "SRIC", 0., 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .6 - .025, 0., 0, "ONLY");
+ gMC->Gspos("FOOT", 1, "SRIC", 64.95, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, 36.9, 0, "ONLY");
+ gMC->Gspos("FOOT", 2, "SRIC", 21.65, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3 , 36.9, 0, "ONLY");
+ gMC->Gspos("FOOT", 3, "SRIC", -21.65, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, 36.9, 0, "ONLY");
+ gMC->Gspos("FOOT", 4, "SRIC", -64.95, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, 36.9, 0, "ONLY");
+ gMC->Gspos("FOOT", 5, "SRIC", 64.95, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, -36.9, 0, "ONLY");
+ gMC->Gspos("FOOT", 6, "SRIC", 21.65, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, -36.9, 0, "ONLY");
+ gMC->Gspos("FOOT", 7, "SRIC", -21.65, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, -36.9, 0, "ONLY");
+ gMC->Gspos("FOOT", 8, "SRIC", -64.95, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, -36.9, 0, "ONLY");
+ gMC->Gspos("OQUA", 1, "SRIC", 0., 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .2, 0., 0, "ONLY");
+// Methane supports
+ gMC->Gspos("SMLG", 1, "SRIC", csi_width/2 + (66.3 - csi_width/2)/2, 1.276 + .25, 0., 0, "ONLY");
+ gMC->Gspos("SMLG", 2, "SRIC", - csi_width/2 - (66.3 - csi_width/2)/2, 1.276 + .25, 0., 0, "ONLY");
+ gMC->Gspos("SMSH", 1, "SRIC", 0., 1.276 + .25, csi_length/2 + (68.35 - csi_length/2)/2, 0, "ONLY");
+ gMC->Gspos("SMSH", 2, "SRIC", 0., 1.276 + .25, - csi_length/2 - (68.35 - csi_length/2)/2, 0, "ONLY");
+//Freon supports
+ Float_t supp_y = 1.276 - fpParam->GapThickness()/2- fpParam->QuartzThickness() -fpParam->FreonThickness() - .2 + .3; //y position of freon supports
+ gMC->Gspos("SFLG", 1, "SRIC", fpParam->QuartzWidth()/2 + (66.3 - fpParam->QuartzWidth()/2)/2, supp_y, 0., 0, "ONLY");
+ gMC->Gspos("SFLG", 2, "SRIC", - fpParam->QuartzWidth()/2 - (66.3 - fpParam->QuartzWidth()/2)/2, supp_y, 0., 0, "ONLY");
+ gMC->Gspos("SFSH", 1, "SRIC", 0., supp_y, fpParam->QuartzLength()/2 + (68.35 - fpParam->QuartzLength()/2)/2, 0, "ONLY");
+ gMC->Gspos("SFSH", 2, "SRIC", 0., supp_y, - fpParam->QuartzLength()/2 - (68.35 - fpParam->QuartzLength()/2)/2, 0, "ONLY");
+ AliMatrix(idrotm[1019], 0., 0., 90., 0., 90., 90.);
+//Place spacers
+ Int_t nspacers = 30;
+ for (i = 0; i < nspacers/3; i++) {
+ zs = -11.6/2 + (TMath::Abs(nspacers/6) - i) * 12.2;
+ gMC->Gspos("SPAC", i, "FRE1", 10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
+ }
+ for (i = nspacers/3; i < (nspacers*2)/3; i++) {
+ zs = -11.6/2 + (nspacers/3 + TMath::Abs(nspacers/6) - i) * 12.2;
+ gMC->Gspos("SPAC", i, "FRE1", 0, 0., zs, idrotm[1019], "ONLY"); //Original settings
+ }
+ for (i = (nspacers*2)/3; i < nspacers; ++i) {
+ zs = -11.6/2 + ((nspacers*2)/3 + TMath::Abs(nspacers/6) - i) * 12.2;
+ gMC->Gspos("SPAC", i, "FRE1", -10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
+ }
+ for (i = 0; i < nspacers/3; i++) {
+ zs = -11.6/2 + (TMath::Abs(nspacers/6) - i) * 12.2;
+ gMC->Gspos("SPAC", i, "FRE2", 10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
+ }
+ for (i = nspacers/3; i < (nspacers*2)/3; i++) {
+ zs = -11.6/2 + (nspacers/3 + TMath::Abs(nspacers/6) - i) * 12.2;
+ gMC->Gspos("SPAC", i, "FRE2", 0, 0., zs, idrotm[1019], "ONLY"); //Original settings
+ }
+ for (i = (nspacers*2)/3; i < nspacers; ++i) {
+ zs = -11.6/2 + ((nspacers*2)/3 + TMath::Abs(nspacers/6) - i) * 12.2;
+ gMC->Gspos("SPAC", i, "FRE2", -10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
+ }
+ gMC->Gspos("FRE1", 1, "OQF1", 0., 0., 0., 0, "ONLY");
+ gMC->Gspos("FRE2", 1, "OQF2", 0., 0., 0., 0, "ONLY");
+ gMC->Gspos("OQF1", 1, "SRIC", fpParam->OuterFreonWidth()/2 + fpParam->InnerFreonWidth()/2 + 2, 1.276 - fpParam->GapThickness()/2- fpParam->QuartzThickness() -fpParam->FreonThickness()/2, 0., 0, "ONLY"); //Original settings (31.3)
+ gMC->Gspos("OQF2", 2, "SRIC", 0., 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()/2, 0., 0, "ONLY"); //Original settings
+ gMC->Gspos("OQF1", 3, "SRIC", - (fpParam->OuterFreonWidth()/2 + fpParam->InnerFreonWidth()/2) - 2, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()/2, 0., 0, "ONLY"); //Original settings (-31.3)
+ gMC->Gspos("QUAR", 1, "SRIC", 0., 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness()/2, 0., 0, "ONLY");
+ gMC->Gspos("GAP ", 1, "META", 0., fpParam->GapThickness()/2 - fpParam->ProximityGapThickness()/2 - 0.0001, 0., 0, "ONLY");
+ gMC->Gspos("META", 1, "SRIC", 0., 1.276, 0., 0, "ONLY");
+ gMC->Gspos("CSI ", 1, "SRIC", 0., 1.276 + fpParam->GapThickness()/2 + .25, 0., 0, "ONLY");
+//Wire support placing
+ gMC->Gspos("WSG2", 1, "GAP ", 0., fpParam->ProximityGapThickness()/2 - .1, 0., 0, "ONLY");
+ gMC->Gspos("WSG1", 1, "CSI ", 0., 0., 0., 0, "ONLY");
+ gMC->Gspos("WSMe", 1, "SRIC ", 0., 1.276 + fpParam->GapThickness()/2 + .5 + 1.05, 0., 0, "ONLY");
+//Backplane placing
+ gMC->Gspos("BACK", 1, "SRIC ", -33.15, 1.276 + fpParam->GapThickness()/2 + .5 + 2.1 + 2, 43.3, 0, "ONLY");
+ gMC->Gspos("BACK", 2, "SRIC ", 33.15, 1.276 + fpParam->GapThickness()/2 + .5 + 2.1 + 2 , 43.3, 0, "ONLY");
+ gMC->Gspos("BACK", 3, "SRIC ", -33.15, 1.276 + fpParam->GapThickness()/2 + .5 + 2.1 + 2, 0., 0, "ONLY");
+ gMC->Gspos("BACK", 4, "SRIC ", 33.15, 1.276 + fpParam->GapThickness()/2 + .5 + 2.1 + 2, 0., 0, "ONLY");
+ gMC->Gspos("BACK", 5, "SRIC ", 33.15, 1.276 + fpParam->GapThickness()/2 + .5 + 2.1 + 2, -43.3, 0, "ONLY");
+ gMC->Gspos("BACK", 6, "SRIC ", -33.15, 1.276 + fpParam->GapThickness()/2 + .5 + 2.1 + 2, -43.3, 0, "ONLY");
+//PCB placing
+ gMC->Gspos("PCB ", 1, "SRIC ", 0., 1.276 + fpParam->GapThickness()/2 + .5 + 1.05, csi_width/4 + .5025 + 2.5, 0, "ONLY");
+ gMC->Gspos("PCB ", 2, "SRIC ", 0., 1.276 + fpParam->GapThickness()/2 + .5 + 1.05, -csi_width/4 - .5025 - 2.5, 0, "ONLY");
+
+//place chambers into mother volume ALIC
+ CreateChambers();
+
+ for(int i=0;i<kNCH;i++){
+ AliMatrix(idrotm[1000+i],C(i)->ThetaXd(),C(i)->PhiXd(),
+ C(i)->ThetaYd(),C(i)->PhiYd(),
+ C(i)->ThetaZd(),C(i)->PhiZd());
+ gMC->Gspos("RICH",i+1,"ALIC",C(i)->X(),C(i)->Y(),C(i)->Z(),idrotm[1000+i], "ONLY");
+ }
+
+ if(GetDebug())Info("CreateGeometry","Stop.");
+}//void AliRICH::CreateGeometry()
+//______________________________________________________________________________
+void AliRICH::CreateChambers()
+{//(re)create all RICH Chambers
+ if(GetDebug())Info("CreateChambers","Start.");
+
+ if(fChambers) delete fChambers;//recreate chambers
+ fChambers=new TObjArray(kNCH);
+ fChambers->SetOwner();
+ for(int i=0;i<kNCH;i++){
+ fChambers->AddAt(new AliRICHChamber(i+1,fpParam),i);
+ }
+
+ if(GetDebug())Info("CreateChambers","Stop.");
+}//void AliRICH::CreateChambers()