X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSv0.cxx;h=79f776242355898348a0672923b5567af3e641cd;hb=81b0fcd1bb6a255db661280665157d12b6486be7;hp=8f1bb1555646e9d5b01b3dde74c3e00f41f292e4;hpb=9110b6c70b7881977289636b82cf62e68a0b0fa3;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSv0.cxx b/PHOS/AliPHOSv0.cxx index 8f1bb155564..79f77624235 100644 --- a/PHOS/AliPHOSv0.cxx +++ b/PHOS/AliPHOSv0.cxx @@ -12,12 +12,15 @@ * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ - /* $Id$ */ + //_________________________________________________________________________ // Implementation version v0 of PHOS Manager class // Layout EMC + PPSD has name GPS2 +// Layout EMC + CPV has name IHEP +// An object of this class does not produce hits nor digits +// It is the one to use if you do not want to produce outputs in TREEH or TREED // //*-- Author: Yves Schutz (SUBATECH) @@ -27,6 +30,11 @@ #include "TBRIK.h" #include "TNode.h" #include "TRandom.h" +#include "TGeometry.h" +#include "TFolder.h" +#include "TROOT.h" +#include "TTree.h" + // --- Standard library --- @@ -38,176 +46,29 @@ // --- AliRoot header files --- #include "AliPHOSv0.h" -#include "AliPHOSHit.h" -#include "AliPHOSDigit.h" -#include "AliPHOSReconstructioner.h" #include "AliRun.h" #include "AliConst.h" +#include "AliMC.h" +#include "AliPHOSGeometry.h" +#include "AliPHOSGetter.h" ClassImp(AliPHOSv0) -//____________________________________________________________________________ -AliPHOSv0::AliPHOSv0() -{ - // ctor - fNTmpHits = 0 ; - fTmpHits = 0 ; -} - //____________________________________________________________________________ AliPHOSv0::AliPHOSv0(const char *name, const char *title): AliPHOS(name,title) { // ctor : title is used to identify the layout - // GPS2 = 5 modules (EMC + PPSD) - // We use 2 arrays of hits : - // - // - fHits (the "normal" one), which retains the hits associated with - // the current primary particle being tracked - // (this array is reset after each primary has been tracked). - // - // - fTmpHits, which retains all the hits of the current event. It - // is used for the digitization part. - - fPinElectronicNoise = 0.010 ; - fDigitThreshold = 1. ; // 1 GeV - - // We do not want to save in TreeH the raw hits - // fHits = new TClonesArray("AliPHOSHit",100) ; - // gAlice->AddHitList(fHits) ; - - // But save the cumulated hits instead (need to create the branch myself) - // It is put in the Digit Tree because the TreeH is filled after each primary - // and the TreeD at the end of the event (branch is set in FinishEvent() ). - - fTmpHits= new TClonesArray("AliPHOSHit",100) ; - - fNTmpHits = fNhits = 0 ; - - fDigits = new TClonesArray("AliPHOSDigit",100) ; - - - fIshunt = 1 ; // All hits are associated with primary particles + // GPS2 = 5 modules (EMC + PPSD) + // IHEP = 5 modules (EMC + CPV) + // MIXT = 4 modules (EMC + CPV) and 1 module (EMC + PPSD) - // gets an instance of the geometry parameters class - - fGeom = AliPHOSGeometry::GetInstance(title, "") ; + // create the geometry parameters object + // and post it to a folder (Post retrieves the correct geometry) + AliPHOSGetter::GetInstance(gDirectory->GetName(), 0)->PostGeometry() ; - if (fGeom->IsInitialized() ) - cout << "AliPHOSv0 : PHOS geometry intialized for " << fGeom->GetName() << endl ; - else - cout << "AliPHOSv0 : PHOS geometry initialization failed !" << endl ; } -//____________________________________________________________________________ -AliPHOSv0::AliPHOSv0(AliPHOSReconstructioner * Reconstructioner, const char *name, const char *title): - AliPHOS(name,title) -{ - // ctor : title is used to identify the layout - // GPS2 = 5 modules (EMC + PPSD) - // We use 2 arrays of hits : - // - // - fHits (the "normal" one), which retains the hits associated with - // the current primary particle being tracked - // (this array is reset after each primary has been tracked). - // - // - fTmpHits, which retains all the hits of the current event. It - // is used for the digitization part. - - fPinElectronicNoise = 0.010 ; - - // We do not want to save in TreeH the raw hits - //fHits = new TClonesArray("AliPHOSHit",100) ; - - fDigits = new TClonesArray("AliPHOSDigit",100) ; - fTmpHits= new TClonesArray("AliPHOSHit",100) ; - - fNTmpHits = fNhits = 0 ; - - fIshunt = 1 ; // All hits are associated with primary particles - - // gets an instance of the geometry parameters class - fGeom = AliPHOSGeometry::GetInstance(title, "") ; - - if (fGeom->IsInitialized() ) - cout << "AliPHOSv0 : PHOS geometry intialized for " << fGeom->GetName() << endl ; - else - cout << "AliPHOSv0 : PHOS geometry initialization failed !" << endl ; - - // Defining the PHOS Reconstructioner - - fReconstructioner = Reconstructioner ; -} - -//____________________________________________________________________________ -AliPHOSv0::~AliPHOSv0() -{ - // dtor - - fTmpHits->Delete() ; - delete fTmpHits ; - fTmpHits = 0 ; - - fEmcRecPoints->Delete() ; - delete fEmcRecPoints ; - fEmcRecPoints = 0 ; - - fPpsdRecPoints->Delete() ; - delete fPpsdRecPoints ; - fPpsdRecPoints = 0 ; - - fTrackSegments->Delete() ; - delete fTrackSegments ; - fTrackSegments = 0 ; -} - -//____________________________________________________________________________ -void AliPHOSv0::AddHit(Int_t primary, Int_t Id, Float_t * hits) -{ - // Add a hit to the hit list. - // A PHOS hit is the sum of all hits in a single crystal - // or in a single PPSD gas cell - - Int_t hitCounter ; - TClonesArray <mphits = *fTmpHits ; - AliPHOSHit *newHit ; - AliPHOSHit *curHit ; - // AliPHOSHit *curHit2 ; - Bool_t deja = kFALSE ; - - // In any case, fills the fTmpHit TClonesArray (with "accumulated hits") - - newHit = new AliPHOSHit(primary, Id, hits) ; - - // We do not want to save in TreeH the raw hits - // TClonesArray &lhits = *fHits; - - for ( hitCounter = 0 ; hitCounter < fNTmpHits && !deja ; hitCounter++ ) { - curHit = (AliPHOSHit*) ltmphits[hitCounter] ; - if( *curHit == *newHit ) { - *curHit = *curHit + *newHit ; - deja = kTRUE ; - } - } - - if ( !deja ) { - new(ltmphits[fNTmpHits]) AliPHOSHit(*newHit) ; - fNTmpHits++ ; - } - - // We do not want to save in TreeH the raw hits - // new(lhits[fNhits]) AliPHOSHit(*newHit) ; - // fNhits++ ; - - // Please note that the fTmpHits array must survive up to the - // end of the events, so it does not appear e.g. in ResetHits() ( - // which is called at the end of each primary). - - delete newHit; - -} - - //____________________________________________________________________________ void AliPHOSv0::BuildGeometry() { @@ -241,12 +102,21 @@ void AliPHOSv0::BuildGeometry() */ //END_HTML + + AliPHOSGeometry * geom = GetGeometry() ; this->BuildGeometryforPHOS() ; - if ( ( strcmp(fGeom->GetName(), "GPS2" ) == 0 ) ) + if (strcmp(geom->GetName(),"GPS2") == 0) this->BuildGeometryforPPSD() ; + else if (strcmp(geom->GetName(),"IHEP") == 0) + this->BuildGeometryforCPV() ; + else if (strcmp(geom->GetName(),"MIXT") == 0) { + this->BuildGeometryforPPSD() ; + this->BuildGeometryforCPV() ; + } else - cout << "AliPHOSv0::BuildGeometry : no charged particle identification system installed" << endl; + cout << "AliPHOSv0::BuildGeometry : no charged particle identification system installed: " + << "Geometry name = " << geom->GetName() << endl; } @@ -259,55 +129,57 @@ void AliPHOSv0:: BuildGeometryforPHOS(void) const Int_t kColorXTAL = kBlue ; Double_t const kRADDEG = 180.0 / kPI ; - - new TBRIK( "OuterBox", "PHOS box", "void", fGeom->GetOuterBoxSize(0)/2, - fGeom->GetOuterBoxSize(1)/2, - fGeom->GetOuterBoxSize(2)/2 ); + + AliPHOSGeometry * geom = GetGeometry() ; + + new TBRIK( "OuterBox", "PHOS box", "void", geom->GetOuterBoxSize(0)/2, + geom->GetOuterBoxSize(1)/2, + geom->GetOuterBoxSize(2)/2 ); // Textolit Wall box, position inside PHOS - new TBRIK( "TextolitBox", "PHOS Textolit box ", "void", fGeom->GetTextolitBoxSize(0)/2, - fGeom->GetTextolitBoxSize(1)/2, - fGeom->GetTextolitBoxSize(2)/2); + new TBRIK( "TextolitBox", "PHOS Textolit box ", "void", geom->GetTextolitBoxSize(0)/2, + geom->GetTextolitBoxSize(1)/2, + geom->GetTextolitBoxSize(2)/2); // Polystyrene Foam Plate - new TBRIK( "UpperFoamPlate", "PHOS Upper foam plate", "void", fGeom->GetTextolitBoxSize(0)/2, - fGeom->GetSecondUpperPlateThickness()/2, - fGeom->GetTextolitBoxSize(2)/2 ) ; + new TBRIK( "UpperFoamPlate", "PHOS Upper foam plate", "void", geom->GetTextolitBoxSize(0)/2, + geom->GetSecondUpperPlateThickness()/2, + geom->GetTextolitBoxSize(2)/2 ) ; // Air Filled Box - new TBRIK( "AirFilledBox", "PHOS air filled box", "void", fGeom->GetAirFilledBoxSize(0)/2, - fGeom->GetAirFilledBoxSize(1)/2, - fGeom->GetAirFilledBoxSize(2)/2 ); + new TBRIK( "AirFilledBox", "PHOS air filled box", "void", geom->GetAirFilledBoxSize(0)/2, + geom->GetAirFilledBoxSize(1)/2, + geom->GetAirFilledBoxSize(2)/2 ); // Crystals Box - Float_t xtlX = fGeom->GetCrystalSize(0) ; - Float_t xtlY = fGeom->GetCrystalSize(1) ; - Float_t xtlZ = fGeom->GetCrystalSize(2) ; + Float_t xtlX = geom->GetCrystalSize(0) ; + Float_t xtlY = geom->GetCrystalSize(1) ; + Float_t xtlZ = geom->GetCrystalSize(2) ; - Float_t xl = fGeom->GetNPhi() * ( xtlX + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 + fGeom->GetModuleBoxThickness() ; - Float_t yl = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 - + fGeom->GetModuleBoxThickness() / 2.0 ; - Float_t zl = fGeom->GetNZ() * ( xtlZ + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 + fGeom->GetModuleBoxThickness() ; + Float_t xl = geom->GetNPhi() * ( xtlX + 2 * geom->GetGapBetweenCrystals() ) / 2.0 + geom->GetModuleBoxThickness() ; + Float_t yl = ( xtlY + geom->GetCrystalSupportHeight() + geom->GetCrystalWrapThickness() + geom->GetCrystalHolderThickness() ) / 2.0 + + geom->GetModuleBoxThickness() / 2.0 ; + Float_t zl = geom->GetNZ() * ( xtlZ + 2 * geom->GetGapBetweenCrystals() ) / 2.0 + geom->GetModuleBoxThickness() ; new TBRIK( "CrystalsBox", "PHOS crystals box", "void", xl, yl, zl ) ; // position PHOS into ALICE - Float_t r = fGeom->GetIPtoOuterCoverDistance() + fGeom->GetOuterBoxSize(1) / 2.0 ; + Float_t r = geom->GetIPtoOuterCoverDistance() + geom->GetOuterBoxSize(1) / 2.0 ; Int_t number = 988 ; - Float_t pphi = TMath::ATan( fGeom->GetOuterBoxSize(0) / ( 2.0 * fGeom->GetIPtoOuterCoverDistance() ) ) ; + Float_t pphi = TMath::ATan( geom->GetOuterBoxSize(0) / ( 2.0 * geom->GetIPtoOuterCoverDistance() ) ) ; pphi *= kRADDEG ; TNode * top = gAlice->GetGeometry()->GetNode("alice") ; char * nodename = new char[20] ; char * rotname = new char[20] ; - for( Int_t i = 1; i <= fGeom->GetNModules(); i++ ) { - Float_t angle = pphi * 2 * ( i - fGeom->GetNModules() / 2.0 - 0.5 ) ; + for( Int_t i = 1; i <= geom->GetNModules(); i++ ) { + Float_t angle = pphi * 2 * ( i - geom->GetNModules() / 2.0 - 0.5 ) ; sprintf(rotname, "%s%d", "rot", number++) ; new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0); top->cd(); @@ -319,7 +191,7 @@ void AliPHOSv0:: BuildGeometryforPHOS(void) fNodes->Add(outerboxnode) ; outerboxnode->cd() ; // now inside the outer box the textolit box - y = ( fGeom->GetOuterBoxThickness(1) - fGeom->GetUpperPlateThickness() ) / 2. ; + y = ( geom->GetOuterBoxThickness(1) - geom->GetUpperPlateThickness() ) / 2. ; sprintf(nodename,"%s%d", "TexBox", i) ; TNode * textolitboxnode = new TNode(nodename, nodename, "TextolitBox", 0, y, 0) ; textolitboxnode->SetLineColor(kColorPHOS) ; @@ -327,26 +199,29 @@ void AliPHOSv0:: BuildGeometryforPHOS(void) // upper foam plate inside outre box outerboxnode->cd() ; sprintf(nodename, "%s%d", "UFPlate", i) ; - y = ( fGeom->GetTextolitBoxSize(1) - fGeom->GetSecondUpperPlateThickness() ) / 2.0 ; + y = ( geom->GetTextolitBoxSize(1) - geom->GetSecondUpperPlateThickness() ) / 2.0 ; TNode * upperfoamplatenode = new TNode(nodename, nodename, "UpperFoamPlate", 0, y, 0) ; upperfoamplatenode->SetLineColor(kColorPHOS) ; fNodes->Add(upperfoamplatenode) ; // air filled box inside textolit box (not drawn) textolitboxnode->cd(); - y = ( fGeom->GetTextolitBoxSize(1) - fGeom->GetAirFilledBoxSize(1) ) / 2.0 - fGeom->GetSecondUpperPlateThickness() ; + y = ( geom->GetTextolitBoxSize(1) - geom->GetAirFilledBoxSize(1) ) / 2.0 - geom->GetSecondUpperPlateThickness() ; sprintf(nodename, "%s%d", "AFBox", i) ; TNode * airfilledboxnode = new TNode(nodename, nodename, "AirFilledBox", 0, y, 0) ; fNodes->Add(airfilledboxnode) ; // crystals box inside air filled box airfilledboxnode->cd() ; - y = fGeom->GetAirFilledBoxSize(1) / 2.0 - yl - - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetModuleBoxThickness() - - fGeom->GetUpperPlateThickness() - fGeom->GetSecondUpperPlateThickness() ) ; + y = geom->GetAirFilledBoxSize(1) / 2.0 - yl + - ( geom->GetIPtoCrystalSurface() - geom->GetIPtoOuterCoverDistance() - geom->GetModuleBoxThickness() + - geom->GetUpperPlateThickness() - geom->GetSecondUpperPlateThickness() ) ; sprintf(nodename, "%s%d", "XTBox", i) ; TNode * crystalsboxnode = new TNode(nodename, nodename, "CrystalsBox", 0, y, 0) ; crystalsboxnode->SetLineColor(kColorXTAL) ; fNodes->Add(crystalsboxnode) ; } + + delete[] rotname ; + delete[] nodename ; } //____________________________________________________________________________ @@ -379,80 +254,88 @@ void AliPHOSv0:: BuildGeometryforPPSD(void) const Int_t kColorGas = kBlue ; const Int_t kColorAir = kYellow ; + AliPHOSGeometry * geom = GetGeometry() ; + // Box for a full PHOS module - new TBRIK( "PPSDBox", "PPSD box", "void", fGeom->GetPPSDBoxSize(0)/2, - fGeom->GetPPSDBoxSize(1)/2, - fGeom->GetPPSDBoxSize(2)/2 ); + new TBRIK( "PPSDBox", "PPSD box", "void", geom->GetCPVBoxSize(0)/2, + geom->GetCPVBoxSize(1)/2, + geom->GetCPVBoxSize(2)/2 ); // Box containing one micromegas module - new TBRIK( "PPSDModule", "PPSD module", "void", fGeom->GetPPSDModuleSize(0)/2, - fGeom->GetPPSDModuleSize(1)/2, - fGeom->GetPPSDModuleSize(2)/2 ); + new TBRIK( "PPSDModule", "PPSD module", "void", geom->GetPPSDModuleSize(0)/2, + geom->GetPPSDModuleSize(1)/2, + geom->GetPPSDModuleSize(2)/2 ); // top lid - new TBRIK ( "TopLid", "Micromegas top lid", "void", fGeom->GetPPSDModuleSize(0)/2, - fGeom->GetLidThickness()/2, - fGeom->GetPPSDModuleSize(2)/2 ) ; + new TBRIK ( "TopLid", "Micromegas top lid", "void", geom->GetPPSDModuleSize(0)/2, + geom->GetLidThickness()/2, + geom->GetPPSDModuleSize(2)/2 ) ; // composite panel (top and bottom) - new TBRIK ( "TopPanel", "Composite top panel", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2, - fGeom->GetCompositeThickness()/2, - ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ; + new TBRIK ( "TopPanel", "Composite top panel", "void", ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() )/2, + geom->GetCompositeThickness()/2, + ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() )/2 ) ; - new TBRIK ( "BottomPanel", "Composite bottom panel", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2, - fGeom->GetCompositeThickness()/2, - ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ; + new TBRIK ( "BottomPanel", "Composite bottom panel", "void", ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() )/2, + geom->GetCompositeThickness()/2, + ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() )/2 ) ; // gas gap (conversion and avalanche) - new TBRIK ( "GasGap", "gas gap", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2, - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() )/2, - ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ; + new TBRIK ( "GasGap", "gas gap", "void", ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() )/2, + ( geom->GetConversionGap() + geom->GetAvalancheGap() )/2, + ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() )/2 ) ; // anode and cathode - new TBRIK ( "Anode", "Anode", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2, - fGeom->GetAnodeThickness()/2, - ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ; + new TBRIK ( "Anode", "Anode", "void", ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() )/2, + geom->GetAnodeThickness()/2, + ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() )/2 ) ; - new TBRIK ( "Cathode", "Cathode", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2, - fGeom->GetCathodeThickness()/2, - ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ; + new TBRIK ( "Cathode", "Cathode", "void", ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() )/2, + geom->GetCathodeThickness()/2, + ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() )/2 ) ; // PC - new TBRIK ( "PCBoard", "Printed Circuit", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2, - fGeom->GetPCThickness()/2, - ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ; + new TBRIK ( "PCBoard", "Printed Circuit", "void", ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() )/2, + geom->GetPCThickness()/2, + ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() )/2 ) ; // Gap between Lead and top micromegas - new TBRIK ( "LeadToM", "Air Gap top", "void", fGeom->GetPPSDBoxSize(0)/2, - fGeom->GetMicro1ToLeadGap()/2, - fGeom->GetPPSDBoxSize(2)/2 ) ; + new TBRIK ( "LeadToM", "Air Gap top", "void", geom->GetCPVBoxSize(0)/2, + geom->GetMicro1ToLeadGap()/2, + geom->GetCPVBoxSize(2)/2 ) ; // Gap between Lead and bottom micromegas - new TBRIK ( "MToLead", "Air Gap bottom", "void", fGeom->GetPPSDBoxSize(0)/2, - fGeom->GetLeadToMicro2Gap()/2, - fGeom->GetPPSDBoxSize(2)/2 ) ; + new TBRIK ( "MToLead", "Air Gap bottom", "void", geom->GetCPVBoxSize(0)/2, + geom->GetLeadToMicro2Gap()/2, + geom->GetCPVBoxSize(2)/2 ) ; // Lead converter - new TBRIK ( "Lead", "Lead converter", "void", fGeom->GetPPSDBoxSize(0)/2, - fGeom->GetLeadConverterThickness()/2, - fGeom->GetPPSDBoxSize(2)/2 ) ; + new TBRIK ( "Lead", "Lead converter", "void", geom->GetCPVBoxSize(0)/2, + geom->GetLeadConverterThickness()/2, + geom->GetCPVBoxSize(2)/2 ) ; // position PPSD into ALICE char * nodename = new char[20] ; char * rotname = new char[20] ; - Float_t r = fGeom->GetIPtoTopLidDistance() + fGeom->GetPPSDBoxSize(1) / 2.0 ; + Float_t r = geom->GetIPtoTopLidDistance() + geom->GetCPVBoxSize(1) / 2.0 ; Int_t number = 988 ; TNode * top = gAlice->GetGeometry()->GetNode("alice") ; - for( Int_t i = 1; i <= fGeom->GetNModules(); i++ ) { // the number of PHOS modules - Float_t angle = fGeom->GetPHOSAngle(i) ; - sprintf(rotname, "%s%d", "rotg", number++) ; + Int_t firstModule = 0 ; + if (strcmp(geom->GetName(),"GPS2") == 0) + firstModule = 1; + else if (strcmp(geom->GetName(),"MIXT") == 0) + firstModule = geom->GetNModules() - geom->GetNPPSDModules() + 1; + + for( Int_t i = firstModule; i <= geom->GetNModules(); i++ ) { // the number of PHOS modules + Float_t angle = geom->GetPHOSAngle(i) ; + sprintf(rotname, "%s%d", "rotg", number+i) ; new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0); top->cd(); sprintf(nodename, "%s%d", "Moduleg", i) ; @@ -464,13 +347,13 @@ void AliPHOSv0:: BuildGeometryforPPSD(void) ppsdboxnode->cd() ; // inside the PPSD box: // 1. fNumberOfModulesPhi x fNumberOfModulesZ top micromegas - x = ( fGeom->GetPPSDBoxSize(0) - fGeom->GetPPSDModuleSize(0) ) / 2. ; + x = ( geom->GetCPVBoxSize(0) - geom->GetPPSDModuleSize(0) ) / 2. ; { - for ( Int_t iphi = 1; iphi <= fGeom->GetNumberOfModulesPhi(); iphi++ ) { // the number of micromegas modules in phi per PHOS module - Float_t z = ( fGeom->GetPPSDBoxSize(2) - fGeom->GetPPSDModuleSize(2) ) / 2. ; + for ( Int_t iphi = 1; iphi <= geom->GetNumberOfModulesPhi(); iphi++ ) { // the number of micromegas modules in phi per PHOS module + Float_t z = ( geom->GetCPVBoxSize(2) - geom->GetPPSDModuleSize(2) ) / 2. ; TNode * micro1node ; - for ( Int_t iz = 1; iz <= fGeom->GetNumberOfModulesZ(); iz++ ) { // the number of micromegas modules in z per PHOS module - y = ( fGeom->GetPPSDBoxSize(1) - fGeom->GetMicromegas1Thickness() ) / 2. ; + for ( Int_t iz = 1; iz <= geom->GetNumberOfModulesZ(); iz++ ) { // the number of micromegas modules in z per PHOS module + y = ( geom->GetCPVBoxSize(1) - geom->GetMicromegas1Thickness() ) / 2. ; sprintf(nodename, "%s%d%d%d", "Mic1", i, iphi, iz) ; micro1node = new TNode(nodename, nodename, "PPSDModule", x, y, z) ; micro1node->SetLineColor(kColorPPSD) ; @@ -478,81 +361,81 @@ void AliPHOSv0:: BuildGeometryforPPSD(void) // inside top micromegas micro1node->cd() ; // a. top lid - y = ( fGeom->GetMicromegas1Thickness() - fGeom->GetLidThickness() ) / 2. ; + y = ( geom->GetMicromegas1Thickness() - geom->GetLidThickness() ) / 2. ; sprintf(nodename, "%s%d%d%d", "Lid", i, iphi, iz) ; TNode * toplidnode = new TNode(nodename, nodename, "TopLid", 0, y, 0) ; toplidnode->SetLineColor(kColorPPSD) ; fNodes->Add(toplidnode) ; // b. composite panel - y = y - fGeom->GetLidThickness() / 2. - fGeom->GetCompositeThickness() / 2. ; + y = y - geom->GetLidThickness() / 2. - geom->GetCompositeThickness() / 2. ; sprintf(nodename, "%s%d%d%d", "CompU", i, iphi, iz) ; TNode * compupnode = new TNode(nodename, nodename, "TopPanel", 0, y, 0) ; compupnode->SetLineColor(kColorPPSD) ; fNodes->Add(compupnode) ; // c. anode - y = y - fGeom->GetCompositeThickness() / 2. - fGeom->GetAnodeThickness() / 2. ; + y = y - geom->GetCompositeThickness() / 2. - geom->GetAnodeThickness() / 2. ; sprintf(nodename, "%s%d%d%d", "Ano", i, iphi, iz) ; TNode * anodenode = new TNode(nodename, nodename, "Anode", 0, y, 0) ; anodenode->SetLineColor(kColorPHOS) ; fNodes->Add(anodenode) ; // d. gas - y = y - fGeom->GetAnodeThickness() / 2. - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. ; + y = y - geom->GetAnodeThickness() / 2. - ( geom->GetConversionGap() + geom->GetAvalancheGap() ) / 2. ; sprintf(nodename, "%s%d%d%d", "GGap", i, iphi, iz) ; TNode * ggapnode = new TNode(nodename, nodename, "GasGap", 0, y, 0) ; ggapnode->SetLineColor(kColorGas) ; fNodes->Add(ggapnode) ; // f. cathode - y = y - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. - fGeom->GetCathodeThickness() / 2. ; + y = y - ( geom->GetConversionGap() + geom->GetAvalancheGap() ) / 2. - geom->GetCathodeThickness() / 2. ; sprintf(nodename, "%s%d%d%d", "Cathode", i, iphi, iz) ; TNode * cathodenode = new TNode(nodename, nodename, "Cathode", 0, y, 0) ; cathodenode->SetLineColor(kColorPHOS) ; fNodes->Add(cathodenode) ; // g. printed circuit - y = y - fGeom->GetCathodeThickness() / 2. - fGeom->GetPCThickness() / 2. ; + y = y - geom->GetCathodeThickness() / 2. - geom->GetPCThickness() / 2. ; sprintf(nodename, "%s%d%d%d", "PC", i, iphi, iz) ; TNode * pcnode = new TNode(nodename, nodename, "PCBoard", 0, y, 0) ; pcnode->SetLineColor(kColorPPSD) ; fNodes->Add(pcnode) ; // h. composite panel - y = y - fGeom->GetPCThickness() / 2. - fGeom->GetCompositeThickness() / 2. ; + y = y - geom->GetPCThickness() / 2. - geom->GetCompositeThickness() / 2. ; sprintf(nodename, "%s%d%d%d", "CompDown", i, iphi, iz) ; TNode * compdownnode = new TNode(nodename, nodename, "BottomPanel", 0, y, 0) ; compdownnode->SetLineColor(kColorPPSD) ; fNodes->Add(compdownnode) ; - z = z - fGeom->GetPPSDModuleSize(2) ; + z = z - geom->GetPPSDModuleSize(2) ; ppsdboxnode->cd() ; } // end of Z module loop - x = x - fGeom->GetPPSDModuleSize(0) ; + x = x - geom->GetPPSDModuleSize(0) ; ppsdboxnode->cd() ; } // end of phi module loop } // 2. air gap ppsdboxnode->cd() ; - y = ( fGeom->GetPPSDBoxSize(1) - 2 * fGeom->GetMicromegas1Thickness() - fGeom->GetMicro1ToLeadGap() ) / 2. ; + y = ( geom->GetCPVBoxSize(1) - 2 * geom->GetMicromegas1Thickness() - geom->GetMicro1ToLeadGap() ) / 2. ; sprintf(nodename, "%s%d", "GapUp", i) ; TNode * gapupnode = new TNode(nodename, nodename, "LeadToM", 0, y, 0) ; gapupnode->SetLineColor(kColorAir) ; fNodes->Add(gapupnode) ; // 3. lead converter - y = y - fGeom->GetMicro1ToLeadGap() / 2. - fGeom->GetLeadConverterThickness() / 2. ; + y = y - geom->GetMicro1ToLeadGap() / 2. - geom->GetLeadConverterThickness() / 2. ; sprintf(nodename, "%s%d", "LeadC", i) ; TNode * leadcnode = new TNode(nodename, nodename, "Lead", 0, y, 0) ; leadcnode->SetLineColor(kColorPPSD) ; fNodes->Add(leadcnode) ; // 4. air gap - y = y - fGeom->GetLeadConverterThickness() / 2. - fGeom->GetLeadToMicro2Gap() / 2. ; + y = y - geom->GetLeadConverterThickness() / 2. - geom->GetLeadToMicro2Gap() / 2. ; sprintf(nodename, "%s%d", "GapDown", i) ; TNode * gapdownnode = new TNode(nodename, nodename, "MToLead", 0, y, 0) ; gapdownnode->SetLineColor(kColorAir) ; fNodes->Add(gapdownnode) ; // 5. fNumberOfModulesPhi x fNumberOfModulesZ bottom micromegas - x = ( fGeom->GetPPSDBoxSize(0) - fGeom->GetPPSDModuleSize(0) ) / 2. - fGeom->GetPhiDisplacement() ; + x = ( geom->GetCPVBoxSize(0) - geom->GetPPSDModuleSize(0) ) / 2. - geom->GetPhiDisplacement() ; { - for ( Int_t iphi = 1; iphi <= fGeom->GetNumberOfModulesPhi(); iphi++ ) { - Float_t z = ( fGeom->GetPPSDBoxSize(2) - fGeom->GetPPSDModuleSize(2) ) / 2. - fGeom->GetZDisplacement() ;; + for ( Int_t iphi = 1; iphi <= geom->GetNumberOfModulesPhi(); iphi++ ) { + Float_t z = ( geom->GetCPVBoxSize(2) - geom->GetPPSDModuleSize(2) ) / 2. - geom->GetZDisplacement() ;; TNode * micro2node ; - for ( Int_t iz = 1; iz <= fGeom->GetNumberOfModulesZ(); iz++ ) { - y = - ( fGeom->GetPPSDBoxSize(1) - fGeom->GetMicromegas2Thickness() ) / 2. ; + for ( Int_t iz = 1; iz <= geom->GetNumberOfModulesZ(); iz++ ) { + y = - ( geom->GetCPVBoxSize(1) - geom->GetMicromegas2Thickness() ) / 2. ; sprintf(nodename, "%s%d%d%d", "Mic2", i, iphi, iz) ; micro2node = new TNode(nodename, nodename, "PPSDModule", x, y, z) ; micro2node->SetLineColor(kColorPPSD) ; @@ -560,59 +443,204 @@ void AliPHOSv0:: BuildGeometryforPPSD(void) // inside bottom micromegas micro2node->cd() ; // a. top lid - y = ( fGeom->GetMicromegas2Thickness() - fGeom->GetLidThickness() ) / 2. ; - sprintf(nodename, "%s%d", "Lidb", i) ; + + y = ( geom->GetMicromegas2Thickness() - geom->GetLidThickness() ) / 2. ; + sprintf(nodename, "%s%d%d%d", "Lidb", i, iphi, iz) ; + TNode * toplidbnode = new TNode(nodename, nodename, "TopLid", 0, y, 0) ; toplidbnode->SetLineColor(kColorPPSD) ; fNodes->Add(toplidbnode) ; // b. composite panel - y = y - fGeom->GetLidThickness() / 2. - fGeom->GetCompositeThickness() / 2. ; - sprintf(nodename, "%s%d", "CompUb", i) ; + + y = y - geom->GetLidThickness() / 2. - geom->GetCompositeThickness() / 2. ; + sprintf(nodename, "%s%d%d%d", "CompUb", i, iphi, iz) ; + TNode * compupbnode = new TNode(nodename, nodename, "TopPanel", 0, y, 0) ; compupbnode->SetLineColor(kColorPPSD) ; fNodes->Add(compupbnode) ; // c. anode - y = y - fGeom->GetCompositeThickness() / 2. - fGeom->GetAnodeThickness() / 2. ; - sprintf(nodename, "%s%d", "Anob", i) ; + + y = y - geom->GetCompositeThickness() / 2. - geom->GetAnodeThickness() / 2. ; + sprintf(nodename, "%s%d%d%d", "Anob", i, iphi, iz) ; + TNode * anodebnode = new TNode(nodename, nodename, "Anode", 0, y, 0) ; anodebnode->SetLineColor(kColorPPSD) ; fNodes->Add(anodebnode) ; // d. conversion gas - y = y - fGeom->GetAnodeThickness() / 2. - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. ; - sprintf(nodename, "%s%d", "GGapb", i) ; + + y = y - geom->GetAnodeThickness() / 2. - ( geom->GetConversionGap() + geom->GetAvalancheGap() ) / 2. ; + sprintf(nodename, "%s%d%d%d", "GGapb", i, iphi, iz) ; + TNode * ggapbnode = new TNode(nodename, nodename, "GasGap", 0, y, 0) ; ggapbnode->SetLineColor(kColorGas) ; fNodes->Add(ggapbnode) ; // f. cathode - y = y - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. - fGeom->GetCathodeThickness() / 2. ; - sprintf(nodename, "%s%d", "Cathodeb", i) ; + + y = y - ( geom->GetConversionGap() + geom->GetAvalancheGap() ) / 2. - geom->GetCathodeThickness() / 2. ; + sprintf(nodename, "%s%d%d%d", "Cathodeb", i, iphi, iz) ; + TNode * cathodebnode = new TNode(nodename, nodename, "Cathode", 0, y, 0) ; cathodebnode->SetLineColor(kColorPPSD) ; fNodes->Add(cathodebnode) ; // g. printed circuit - y = y - fGeom->GetCathodeThickness() / 2. - fGeom->GetPCThickness() / 2. ; - sprintf(nodename, "%s%d", "PCb", i) ; + y = y - geom->GetCathodeThickness() / 2. - geom->GetPCThickness() / 2. ; + sprintf(nodename, "%s%d%d%d", "PCb", i, iphi, iz) ; TNode * pcbnode = new TNode(nodename, nodename, "PCBoard", 0, y, 0) ; pcbnode->SetLineColor(kColorPPSD) ; fNodes->Add(pcbnode) ; // h. composite pane - y = y - fGeom->GetPCThickness() / 2. - fGeom->GetCompositeThickness() / 2. ; - sprintf(nodename, "%s%d", "CompDownb", i) ; + y = y - geom->GetPCThickness() / 2. - geom->GetCompositeThickness() / 2. ; + sprintf(nodename, "%s%d%d%d", "CompDownb", i, iphi, iz) ; TNode * compdownbnode = new TNode(nodename, nodename, "BottomPanel", 0, y, 0) ; compdownbnode->SetLineColor(kColorPPSD) ; fNodes->Add(compdownbnode) ; - z = z - fGeom->GetPPSDModuleSize(2) ; + z = z - geom->GetPPSDModuleSize(2) ; ppsdboxnode->cd() ; } // end of Z module loop - x = x - fGeom->GetPPSDModuleSize(0) ; + x = x - geom->GetPPSDModuleSize(0) ; ppsdboxnode->cd() ; } // end of phi module loop } } // PHOS modules - delete rotname ; - delete nodename ; + delete[] rotname ; + delete[] nodename ; + +} + +//____________________________________________________________________________ +void AliPHOSv0:: BuildGeometryforCPV(void) +{ + // Build the PHOS-CPV geometry for the ROOT display + // Author: Yuri Kharlov 11 September 2000 + // + //BEGIN_HTML + /* +
CPV perspective view | +CPV front view | +
+ | + |
CPV perspective view | +CPV front view | +
+ | + |
One CPV module, perspective view | +One CPV module, front view (extended in vertical direction) | +
+ | + |
+ */ + //END_HTML - Int_t i; + Float_t par[5], x0,y0,z0 ; + Int_t i,j,copy; - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" PHOS_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); + // Get pointer to the array containing media indexes + Int_t *idtmed = fIdtmed->GetArray() - 699 ; - // Here the PHOS initialisation code (if any!) + AliPHOSGeometry * geom = GetGeometry() ; - for(i=0;i<80;i++) printf("*"); - printf("\n"); - -} + // --- Dummy box containing two rails on which PHOS support moves + // --- Put these rails to the bottom of the L3 magnet -//___________________________________________________________________________ -void AliPHOSv0::MakeBranch(Option_t* opt) -{ - // Create new branche in the current Root Tree in the digit Tree + par[0] = geom->GetRailRoadSize(0) / 2.0 ; + par[1] = geom->GetRailRoadSize(1) / 2.0 ; + par[2] = geom->GetRailRoadSize(2) / 2.0 ; + gMC->Gsvolu("PRRD", "BOX ", idtmed[798], par, 3) ; - AliDetector::MakeBranch(opt) ; - - char branchname[10]; - sprintf(branchname,"%s",GetName()); - char *cdD = strstr(opt,"D"); - - if (fDigits && gAlice->TreeD() && cdD) { - gAlice->TreeD()->Branch(branchname, &fDigits, fBufferSize); - } -} - -//____________________________________________________________________________ -RecPointsList * AliPHOSv0::PpsdRecPoints(Int_t evt) -{ - // returns the pointer to the PPSD RecPoints list - // if the list is empty, get it from TreeR on the disk file + y0 = -(geom->GetRailsDistanceFromIP() - geom->GetRailRoadSize(1) / 2.0) ; + gMC->Gspos("PRRD", 1, "ALIC", 0.0, y0, 0.0, 0, "ONLY") ; - RecPointsList * rv = 0 ; + // --- Dummy box containing one rail - if ( fPpsdRecPoints ) - rv = fPpsdRecPoints ; + par[0] = geom->GetRailOuterSize(0) / 2.0 ; + par[1] = geom->GetRailOuterSize(1) / 2.0 ; + par[2] = geom->GetRailOuterSize(2) / 2.0 ; + gMC->Gsvolu("PRAI", "BOX ", idtmed[798], par, 3) ; - else { - fPpsdRecPoints = new TClonesArray("AliPHOSPpsdRecPoint", 100) ; - gAlice->GetEvent(evt) ; - TTree * fReconstruct = gAlice->TreeR() ; - fReconstruct->SetBranchAddress( "PHOSPpsdRP", &fPpsdRecPoints) ; - fReconstruct->GetEvent(0) ; - rv = fPpsdRecPoints ; + for (i=0; i<2; i++) { + x0 = (2*i-1) * geom->GetDistanceBetwRails() / 2.0 ; + gMC->Gspos("PRAI", i, "PRRD", x0, 0.0, 0.0, 0, "ONLY") ; } - - fPpsdRecPoints->Expand( fPpsdRecPoints->GetEntries() ) ; - - return rv ; - -} -//_____________________________________________________________________________ -void AliPHOSv0::Reconstruction(AliPHOSReconstructioner * Reconstructioner) -{ - // 1. Reinitializes the existing RecPoint, TrackSegment, and RecParticles Lists and - // 2. Creates TreeR wit a branch for each list - // 3. Steers the reconstruction processes - // 4. Saves the 3 lists in TreeR - // 5. Write the Tree to File - - fReconstructioner = Reconstructioner ; - - char branchname[10] ; + // --- Upper and bottom steel parts of the rail - // 1. + par[0] = geom->GetRailPart1(0) / 2.0 ; + par[1] = geom->GetRailPart1(1) / 2.0 ; + par[2] = geom->GetRailPart1(2) / 2.0 ; + gMC->Gsvolu("PRP1", "BOX ", idtmed[716], par, 3) ; - gAlice->MakeTree("R") ; - Int_t splitlevel = 0 ; - - if (fEmcRecPoints) { - fEmcRecPoints->Delete() ; - delete fEmcRecPoints ; - fEmcRecPoints = 0 ; - } + y0 = - (geom->GetRailOuterSize(1) - geom->GetRailPart1(1)) / 2.0 ; + gMC->Gspos("PRP1", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ; + y0 = (geom->GetRailOuterSize(1) - geom->GetRailPart1(1)) / 2.0 - geom->GetRailPart3(1); + gMC->Gspos("PRP1", 2, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ; - // fEmcRecPoints= new RecPointsList("AliPHOSEmcRecPoint", 100) ; if TClonesArray - fEmcRecPoints= new RecPointsList(100) ; + // --- The middle vertical steel parts of the rail - if ( fEmcRecPoints && gAlice->TreeR() ) { - sprintf(branchname,"%sEmcRP",GetName()) ; - - // gAlice->TreeR()->Branch(branchname, &fEmcRecPoints, fBufferSize); if TClonesArray - gAlice->TreeR()->Branch(branchname, "TObjArray", &fEmcRecPoints, fBufferSize, splitlevel) ; - } + par[0] = geom->GetRailPart2(0) / 2.0 ; + par[1] = geom->GetRailPart2(1) / 2.0 ; + par[2] = geom->GetRailPart2(2) / 2.0 ; + gMC->Gsvolu("PRP2", "BOX ", idtmed[716], par, 3) ; - if (fPpsdRecPoints) { - fPpsdRecPoints->Delete() ; - delete fPpsdRecPoints ; - fPpsdRecPoints = 0 ; - } + y0 = - geom->GetRailPart3(1) / 2.0 ; + gMC->Gspos("PRP2", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ; - // fPpsdRecPoints = new RecPointsList("AliPHOSPpsdRecPoint", 100) ; if TClonesArray - fPpsdRecPoints = new RecPointsList(100) ; + // --- The most upper steel parts of the rail - if ( fPpsdRecPoints && gAlice->TreeR() ) { - sprintf(branchname,"%sPpsdRP",GetName()) ; - - // gAlice->TreeR()->Branch(branchname, &fPpsdRecPoints, fBufferSize); if TClonesArray - gAlice->TreeR()->Branch(branchname, "TObjArray", &fPpsdRecPoints, fBufferSize, splitlevel) ; - } + par[0] = geom->GetRailPart3(0) / 2.0 ; + par[1] = geom->GetRailPart3(1) / 2.0 ; + par[2] = geom->GetRailPart3(2) / 2.0 ; + gMC->Gsvolu("PRP3", "BOX ", idtmed[716], par, 3) ; - if (fTrackSegments) { - fTrackSegments->Delete() ; - delete fTrackSegments ; - fTrackSegments = 0 ; - } + y0 = (geom->GetRailOuterSize(1) - geom->GetRailPart3(1)) / 2.0 ; + gMC->Gspos("PRP3", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ; - fTrackSegments = new TrackSegmentsList("AliPHOSTrackSegment", 100) ; - if ( fTrackSegments && gAlice->TreeR() ) { - sprintf(branchname,"%sTS",GetName()) ; - gAlice->TreeR()->Branch(branchname, &fTrackSegments, fBufferSize) ; - } + // --- The wall of the cradle + // --- The wall is empty: steel thin walls and air inside - if (fRecParticles) { - fRecParticles->Delete() ; - delete fRecParticles ; - fRecParticles = 0 ; - } - fRecParticles = new RecParticlesList("AliPHOSRecParticle", 100) ; - if ( fRecParticles && gAlice->TreeR() ) { - sprintf(branchname,"%sRP",GetName()) ; - gAlice->TreeR()->Branch(branchname, &fRecParticles, fBufferSize) ; - } - - // 3. + par[1] = TMath::Sqrt( + TMath::Power((geom->GetIPtoOuterCoverDistance() + geom->GetOuterBoxSize(1)),2) + + TMath::Power((geom->GetOuterBoxSize(0)/2),2)) + 10.; + par[0] = par[1] - geom->GetCradleWall(1) ; + par[2] = geom->GetCradleWall(2) / 2.0 ; + par[3] = geom->GetCradleWall(3) ; + par[4] = geom->GetCradleWall(4) ; + gMC->Gsvolu("PCRA", "TUBS", idtmed[716], par, 5) ; - fReconstructioner->Make(fDigits, fEmcRecPoints, fPpsdRecPoints, fTrackSegments, fRecParticles); + par[0] -= geom->GetCradleWallThickness() ; + par[1] -= geom->GetCradleWallThickness() ; + par[2] -= geom->GetCradleWallThickness() ; + gMC->Gsvolu("PCRE", "TUBS", idtmed[798], par, 5) ; + gMC->Gspos ("PCRE", 1, "PCRA", 0.0, 0.0, 0.0, 0, "ONLY") ; - // 4. Expand or Shrink the arrays to the proper size - - Int_t size ; + for (i=0; i<2; i++) { + z0 = (2*i-1) * (geom->GetOuterBoxSize(2) + geom->GetCradleWall(2)) / 2.0 ; + gMC->Gspos("PCRA", i, "ALIC", 0.0, 0.0, z0, 0, "ONLY") ; + } + + // --- The "wheels" of the cradle - size = fEmcRecPoints->GetEntries() ; - fEmcRecPoints->Expand(size) ; - - size = fPpsdRecPoints->GetEntries() ; - fPpsdRecPoints->Expand(size) ; + par[0] = geom->GetCradleWheel(0) / 2; + par[1] = geom->GetCradleWheel(1) / 2; + par[2] = geom->GetCradleWheel(2) / 2; + gMC->Gsvolu("PWHE", "BOX ", idtmed[716], par, 3) ; + + y0 = -(geom->GetRailsDistanceFromIP() - geom->GetRailRoadSize(1) - + geom->GetCradleWheel(1)/2) ; + for (i=0; i<2; i++) { + z0 = (2*i-1) * ((geom->GetOuterBoxSize(2) + geom->GetCradleWheel(2)) / 2.0 + + geom->GetCradleWall(2)); + for (j=0; j<2; j++) { + copy = 2*i + j; + x0 = (2*j-1) * geom->GetDistanceBetwRails() / 2.0 ; + gMC->Gspos("PWHE", copy, "ALIC", x0, y0, z0, 0, "ONLY") ; + } + } - size = fTrackSegments->GetEntries() ; - fTrackSegments->Expand(size) ; +} - size = fRecParticles->GetEntries() ; - fRecParticles->Expand(size) ; +//____________________________________________________________________________ +Float_t AliPHOSv0::ZMin(void) const +{ + // Overall dimension of the PHOS (min) + // Take it twice more than the PHOS module size - gAlice->TreeR()->Fill() ; - - // 5. + AliPHOSGeometry * geom = GetGeometry() ; - gAlice->TreeR()->Write() ; - + return -geom->GetOuterBoxSize(2); } //____________________________________________________________________________ -void AliPHOSv0::ResetDigits() +Float_t AliPHOSv0::ZMax(void) const { - // May sound strange, but cumulative hits are store in digits Tree + // Overall dimension of the PHOS (max) + // Take it twice more than the PHOS module size - if( fTmpHits ) { - fTmpHits->Delete(); - fNTmpHits = 0 ; - } + AliPHOSGeometry * geom = GetGeometry() ; + + return geom->GetOuterBoxSize(2); } - + //____________________________________________________________________________ -void AliPHOSv0::StepManager(void) +void AliPHOSv0::Init(void) { - // Accumulates hits as long as the track stays in a single crystal or PPSD gas Cell + // Just prints an information message + + Int_t i; - Int_t relid[4] ; // (box, layer, row, column) indices - Float_t xyze[4] ; // position wrt MRS and energy deposited - TLorentzVector pos ; - Int_t copy ; + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" PHOS_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n%s: ",ClassName()); + + + // Here the PHOS initialisation code (if any!) - Int_t primary = gAlice->GetPrimary( gAlice->CurrentTrack() ); - TString name = fGeom->GetName() ; - if ( name == "GPS2" ) { // the CPV is a PPSD - if( gMC->CurrentVolID(copy) == gMC->VolId("GCEL") ) // We are inside a gas cell - { - gMC->TrackPosition(pos) ; - xyze[0] = pos[0] ; - xyze[1] = pos[1] ; - xyze[2] = pos[2] ; - xyze[3] = gMC->Edep() ; - - if ( xyze[3] != 0 ) { // there is deposited energy - gMC->CurrentVolOffID(5, relid[0]) ; // get the PHOS Module number - gMC->CurrentVolOffID(3, relid[1]) ; // get the Micromegas Module number - // 1-> Geom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() upper - // > fGeom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() lower - gMC->CurrentVolOffID(1, relid[2]) ; // get the row number of the cell - gMC->CurrentVolID(relid[3]) ; // get the column number - - // get the absolute Id number - - Int_t absid ; - fGeom->RelToAbsNumbering(relid, absid) ; - - // add current hit to the hit list - AddHit(primary, absid, xyze); - - } // there is deposited energy - } // We are inside the gas of the CPV - } // GPS2 configuration - - if(gMC->CurrentVolID(copy) == gMC->VolId("PXTL") ) // We are inside a PBWO crystal - { - gMC->TrackPosition(pos) ; - xyze[0] = pos[0] ; - xyze[1] = pos[1] ; - xyze[2] = pos[2] ; - xyze[3] = gMC->Edep() ; - - if ( xyze[3] != 0 ) { - gMC->CurrentVolOffID(10, relid[0]) ; // get the PHOS module number ; - relid[1] = 0 ; // means PBW04 - gMC->CurrentVolOffID(4, relid[2]) ; // get the row number inside the module - gMC->CurrentVolOffID(3, relid[3]) ; // get the cell number inside the module - - // get the absolute Id number - - Int_t absid ; - fGeom->RelToAbsNumbering(relid, absid) ; - - // add current hit to the hit list + AliPHOSGeometry * geom = GetGeometry() ; - AddHit(primary, absid, xyze); + if (geom!=0) + cout << "AliPHOS" << Version() << " : PHOS geometry intialized for " << geom->GetName() << endl ; + else + cout << "AliPHOS" << Version() << " : PHOS geometry initialization failed !" << endl ; - } // there is deposited energy - } // we are inside a PHOS Xtal + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } } +