X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSv0.cxx;h=148031249274dcca36d2b9ba485b661b5097e857;hb=6df6d499528f69f8ba5720e7403422784d1456a5;hp=6ca5c7eec39e9dfd70f401bcea95c79bb63138af;hpb=de9ec31b399388ee561c458eaae1c4e22d829ff7;p=u%2Fmrichter%2FAliRoot.git
diff --git a/PHOS/AliPHOSv0.cxx b/PHOS/AliPHOSv0.cxx
index 6ca5c7eec39..14803124927 100644
--- a/PHOS/AliPHOSv0.cxx
+++ b/PHOS/AliPHOSv0.cxx
@@ -12,191 +12,52 @@
* 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
+// 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)
+//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
// --- ROOT system ---
#include "TBRIK.h"
+#include "TTRD1.h"
#include "TNode.h"
#include "TRandom.h"
+#include "TGeometry.h"
+#include "TFolder.h"
+#include "TROOT.h"
+#include "TTree.h"
+
// --- Standard library ---
-#include
-
- PPSD displayed by root
+ CPV displayed by root
-
-
-
-
CPV perspective view | +CPV front view | +
![]() |
+ ![]() |
+
- */ - //END_HTML - - // Get pointer to the array containing media indexes - Int_t *idtmed = fIdtmed->GetArray() - 699 ; - - // The box containing all ppsd's for one PHOS module filled with air - Float_t ppsd[3] ; - ppsd[0] = fGeom->GetPPSDBoxSize(0) / 2.0 ; - ppsd[1] = fGeom->GetPPSDBoxSize(1) / 2.0 ; - ppsd[2] = fGeom->GetPPSDBoxSize(2) / 2.0 ; +
CPV perspective view | +CPV front view | +
![]() |
+ ![]() |
+
One CPV module, perspective view | +One CPV module, front view (extended in vertical direction) | +
![]() |
+ ![]() |
+
+ */ + //END_HTML + + Float_t par[5], x0,y0,z0 ; + Int_t i,j,copy; - // Position the fNumberOfModulesPhi x fNumberOfModulesZ modules (mppsd) inside PPSD to cover a PHOS module - // the top and bottom one's (which are assumed identical) : + // Get pointer to the array containing media indexes + Int_t *idtmed = fIdtmed->GetArray() - 699 ; - Float_t yt = ( fGeom->GetPPSDBoxSize(1) - fGeom->GetMicromegas1Thickness() ) / 2. ; - Float_t yb = - ( fGeom->GetPPSDBoxSize(1) - fGeom->GetMicromegas2Thickness() ) / 2. ; + AliPHOSGeometry * geom = GetGeometry() ; - Int_t copyNumbertop = 0 ; - Int_t copyNumberbot = fGeom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() ; + // --- Dummy box containing two rails on which PHOS support moves + // --- Put these rails to the bottom of the L3 magnet - Float_t x = ( fGeom->GetPPSDBoxSize(0) - fGeom->GetPPSDModuleSize(0) ) / 2. ; + 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) ; - 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. ; + y0 = -(geom->GetRailsDistanceFromIP() - geom->GetRailRoadSize(1) / 2.0) ; + gMC->Gspos("PRRD", 1, "ALIC", 0.0, y0, 0.0, 0, "ONLY") ; - for ( Int_t iz = 1; iz <= fGeom->GetNumberOfModulesZ(); iz++ ) { // the number of micromegas modules in z per PHOS module - gMC->Gspos("MPPS", ++copyNumbertop, "PPSD", x, yt, z, 0, "ONLY") ; - gMC->Gspos("MPPS", ++copyNumberbot, "PPSD", x, yb, z, 0, "ONLY") ; - z = z - fGeom->GetPPSDModuleSize(2) ; - } // end of Z module loop - x = x - fGeom->GetPPSDModuleSize(0) ; - } // end of phi module loop + // --- Dummy box containing one rail - // The Lead converter between two air gaps - // 1. Upper air gap + 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) ; - Float_t uappsd[3] ; - uappsd[0] = fGeom->GetPPSDBoxSize(0) / 2.0 ; - uappsd[1] = fGeom->GetMicro1ToLeadGap() / 2.0 ; - uappsd[2] = fGeom->GetPPSDBoxSize(2) / 2.0 ; + 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") ; + } - gMC->Gsvolu("UAPPSD", "BOX ", idtmed[798], uappsd, 3) ; + // --- Upper and bottom steel parts of the rail - y0 = ( fGeom->GetPPSDBoxSize(1) - 2 * fGeom->GetMicromegas1Thickness() - fGeom->GetMicro1ToLeadGap() ) / 2. ; + 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) ; - gMC->Gspos("UAPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ; + 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") ; - // 2. Lead converter - - Float_t lcppsd[3] ; - lcppsd[0] = fGeom->GetPPSDBoxSize(0) / 2.0 ; - lcppsd[1] = fGeom->GetLeadConverterThickness() / 2.0 ; - lcppsd[2] = fGeom->GetPPSDBoxSize(2) / 2.0 ; - - gMC->Gsvolu("LCPPSD", "BOX ", idtmed[712], lcppsd, 3) ; - - y0 = y0 - fGeom->GetMicro1ToLeadGap() / 2. - fGeom->GetLeadConverterThickness() / 2. ; + // --- The middle vertical steel parts of the rail - gMC->Gspos("LCPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ; + 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) ; - // 3. Lower air gap + y0 = - geom->GetRailPart3(1) / 2.0 ; + gMC->Gspos("PRP2", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ; - Float_t lappsd[3] ; - lappsd[0] = fGeom->GetPPSDBoxSize(0) / 2.0 ; - lappsd[1] = fGeom->GetLeadToMicro2Gap() / 2.0 ; - lappsd[2] = fGeom->GetPPSDBoxSize(2) / 2.0 ; + // --- The most upper steel parts of the rail - gMC->Gsvolu("LAPPSD", "BOX ", idtmed[798], lappsd, 3) ; - - y0 = y0 - fGeom->GetLeadConverterThickness() / 2. - fGeom->GetLeadToMicro2Gap() / 2. ; - - gMC->Gspos("LAPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ; - -} + 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) ; -//___________________________________________________________________________ -Int_t AliPHOSv0::Digitize(Float_t Energy) -{ - // Applies the energy calibration - - Float_t fB = 100. ; // ; 100000000. ; - Float_t fA = 0. ; - Int_t chan = Int_t(fA + Energy*fB ) ; - return chan ; -} + y0 = (geom->GetRailOuterSize(1) - geom->GetRailPart3(1)) / 2.0 ; + gMC->Gspos("PRP3", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ; -//___________________________________________________________________________ -void AliPHOSv0::FinishEvent() -{ - // Makes the digits from the sum of summed hit in a single crystal or PPSD gas cell - // Adds to the energy the electronic noise - // Keeps digits with energy above fDigitThreshold - - Int_t i ; - Int_t relid[4]; - Int_t j ; - TClonesArray &lDigits = *fDigits ; - AliPHOSHit * hit ; - AliPHOSDigit * newdigit ; - AliPHOSDigit * curdigit ; - Bool_t deja = kFALSE ; - - for ( i = 0 ; i < fNTmpHits ; i++ ) { - hit = (AliPHOSHit*)fTmpHits->At(i) ; - newdigit = new AliPHOSDigit( hit->GetPrimary(), hit->GetId(), Digitize( hit->GetEnergy() ) ) ; - deja =kFALSE ; - for ( j = 0 ; j < fNdigits ; j++) { - curdigit = (AliPHOSDigit*) lDigits[j] ; - if ( *curdigit == *newdigit) { - *curdigit = *curdigit + *newdigit ; - deja = kTRUE ; - } - } - if ( !deja ) { - new(lDigits[fNdigits]) AliPHOSDigit(* newdigit) ; - fNdigits++ ; - } - - delete newdigit ; - } - - // Noise induced by the PIN diode of the PbWO crystals + // --- The wall of the cradle + // --- The wall is empty: steel thin walls and air inside - Float_t energyandnoise ; - for ( i = 0 ; i < fNdigits ; i++ ) { - newdigit = (AliPHOSDigit * ) fDigits->At(i) ; - fGeom->AbsToRelNumbering(newdigit->GetId(), relid) ; + par[1] = TMath::Sqrt(TMath::Power((geom->GetIPtoCPVDistance() + geom->GetOuterBoxSize(3)),2) + + TMath::Power((geom->GetOuterBoxSize(1)/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) ; - if (relid[1]==0){ // Digits belong to EMC (PbW0_4 crystals) - energyandnoise = newdigit->GetAmp() + Digitize(gRandom->Gaus(0., fPinElectronicNoise)) ; + 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") ; - if (energyandnoise < 0 ) - energyandnoise = 0 ; + 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") ; + } - if ( newdigit->GetAmp() < fDigitThreshold ) // if threshold not surpassed, remove digit from list - fDigits->RemoveAt(i) ; + // --- The "wheels" of the cradle + + 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") ; } } - - fDigits->Compress() ; - fNTmpHits = 0 ; - fTmpHits->Delete(); - } //____________________________________________________________________________ -void AliPHOSv0::Init(void) +Float_t AliPHOSv0::ZMin(void) const { - // Just prints an information message - - Int_t i; + // Overall dimension of the PHOS (min) - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" PHOS_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); + AliPHOSGeometry * geom = GetGeometry() ; - // Here the PHOS initialisation code (if any!) - - for(i=0;i<80;i++) printf("*"); - printf("\n"); - + return -geom->GetOuterBoxSize(2)/2.; } -//___________________________________________________________________________ -void AliPHOSv0::MakeBranch(Option_t* opt) -{ - // Create new branche in the current Root Tree in the digit Tree - - 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); - } -} - -//_____________________________________________________________________________ -void AliPHOSv0::Reconstruction(AliPHOSReconstructioner * Reconstructioner) -{ - // 1. Reinitializes the existing RecPoint, TrackSegment, and RecParticles Lists and - // 2. Creates a branch in TreeR 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] ; - - // 1. - - if (fEmcClusters) { - fEmcClusters->Delete() ; - delete fEmcClusters ; - fEmcClusters = 0 ; - } - fEmcClusters= new RecPointsList("AliPHOSEmcRecPoint", 100) ; - if ( fEmcClusters && gAlice->TreeR() ) { - sprintf(branchname,"%sERP",GetName()) ; - gAlice->TreeR()->Branch(branchname, &fEmcClusters, fBufferSize); - } - - if (fPpsdClusters) { - fPpsdClusters->Delete() ; - delete fPpsdClusters ; - fPpsdClusters = 0 ; - } - fPpsdClusters = new RecPointsList("AliPHOSPpsdRecPoint", 100) ; - if ( fPpsdClusters && gAlice->TreeR() ) { - sprintf(branchname,"%sPRP",GetName()) ; - gAlice->TreeR()->Branch(branchname, &fPpsdClusters, fBufferSize); - } - - if (fTrackSegments) { - fTrackSegments->Delete() ; - delete fTrackSegments ; - fTrackSegments = 0 ; - } - fTrackSegments = new TrackSegmentsList("AliPHOSTrackSegment", 100) ; - if ( fTrackSegments && gAlice->TreeR() ) { - sprintf(branchname,"%sTS",GetName()) ; - gAlice->TreeR()->Branch(branchname, &fTrackSegments, fBufferSize); - } - - 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. - - fReconstructioner->Make(fDigits, fEmcClusters, fPpsdClusters, fTrackSegments, fRecParticles); - - // 4. +//____________________________________________________________________________ +Float_t AliPHOSv0::ZMax(void) const +{ + // Overall dimension of the PHOS (max) - gAlice->TreeR()->Fill() ; - - // 5. + AliPHOSGeometry * geom = GetGeometry() ; - gAlice->TreeR()->Write() ; - + return geom->GetOuterBoxSize(2)/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 - - Int_t relid[4] ; // (box, layer, row, column) indices - Float_t xyze[4] ; // position wrt MRS and energy deposited - TLorentzVector pos ; - Int_t copy ; - - 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 + // Just prints an information message - 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 + Int_t i; - AddHit(primary, absid, xyze); + if(fDebug) { + TString st ; + for(i=0;i<35;i++) + st += "*"; + Info("Init", "%s", st.Data()) ; + // Here the PHOS initialisation code (if any!) - } // there is deposited energy - } // we are inside a PHOS Xtal -} + AliPHOSGeometry * geom = GetGeometry() ; + + if (geom!=0) + Info("Init", "AliPHOS%s: PHOS geometry intialized for %s", Version().Data(), geom->GetName()) ; + else + Info("Init", "AliPHOS%s: PHOS geometry initialization failed !", Version().Data()) ; + Info("Init", "%s", st.Data()) ; + } +}