X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSv0.cxx;h=2341f1f6993d4e613068e5288679e8817eab94ed;hb=3a457cdb20b5a3613d7087185daa7563f9e0633c;hp=7c77325f4d6484125509fd046b9edbfa2e746206;hpb=2803f2846f1c15e42e702f17cec0cfdfa4a1acff;p=u%2Fmrichter%2FAliRoot.git
diff --git a/PHOS/AliPHOSv0.cxx b/PHOS/AliPHOSv0.cxx
index 7c77325f4d6..2341f1f6993 100644
--- a/PHOS/AliPHOSv0.cxx
+++ b/PHOS/AliPHOSv0.cxx
@@ -12,617 +12,106 @@
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
+/* History of cvs commits:
+ *
+ * $Log$
+ * Revision 1.94 2007/10/18 08:40:02 kharlov
+ * Misalignment-related bug fixed
+ *
+ * Revision 1.93 2007/10/06 22:24:40 kharlov
+ * Bug in strip unit geometry is corrected
+ *
+ * Revision 1.92 2007/07/04 16:38:19 policheh
+ * Tracking2LocalCS matrices corrected for CPV.
+ *
+ * Revision 1.91 2007/07/02 14:50:49 policheh
+ * Tracking2LocalCS matrices corrected.
+ *
+ * Revision 1.90 2007/05/24 13:04:05 policheh
+ * AddAlignableVolumes: local to tracking CS transformation matrices creates for each
+ * PHOS supermodule
+ *
+ * Revision 1.89 2007/04/24 14:34:39 hristov
+ * Additional protection: do not search for alignable object if the CPV is not in the geometry
+ *
+ * Revision 1.88 2007/04/19 15:28:30 kharlov
+ * Modify strip unit geometry according to the final drawings (Timur)
+ *
+ * Revision 1.87 2007/04/01 07:37:10 kharlov
+ * TGeo RS to Local RS transf matr added
+ *
+ * Revision 1.86 2007/03/06 06:55:46 kharlov
+ * DP:Misalignment of CPV added
+ *
+ * Revision 1.85 2007/03/01 11:37:37 kharlov
+ * Strip units changed from 8x1 to 8x2 (T.Pocheptsov)
+ *
+ * Revision 1.84 2006/12/20 16:56:43 kharlov
+ * Optional geometry without CPV
+ *
+ * Revision 1.83 2006/11/14 17:11:15 hristov
+ * Removing inheritances from TAttLine, TAttMarker and AliRndm in AliModule. The copy constructor and assignment operators are moved to the private part of the class and not implemented. The corresponding changes are propagated to the detectors
+ *
+ * Revision 1.82 2006/09/27 19:55:57 kharlov
+ * Alignment object with symbolic volume names are introduced
+ *
+ * Revision 1.81 2006/03/04 20:25:56 kharlov
+ * Set geom parameters from CDB
+ *
+ * Revision 1.80 2005/06/17 07:39:07 hristov
+ * Removing GetDebug and SetDebug from AliRun and AliModule. Using AliLog for the messages
+ *
+ * Revision 1.79 2005/05/28 14:19:05 schutz
+ * Compilation warnings fixed by T.P.
+ *
+ */
+
//_________________________________________________________________________
// 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 "TNode.h"
-#include "TRandom.h"
-
+#include
-
- PHOS in ALICE displayed by root
-
-
-
-
-
-
-
-
-
- */ - //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 ; - - gMC->Gsvolu("PPSD", "BOX ", idtmed[798], ppsd, 3) ; +
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;
- y0 = ( fGeom->GetPPSDBoxSize(1) - 2 * fGeom->GetMicromegas1Thickness() - fGeom->GetMicro1ToLeadGap() ) / 2. ;
+ // Get pointer to the array containing media indexes
+ Int_t *idtmed = fIdtmed->GetArray() - 699 ;
- gMC->Gspos("UAPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ;
+ AliPHOSGeometry * geom = GetGeometry() ;
- // 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. ;
+ // --- Dummy box containing two rails on which PHOS support moves
+ // --- Put these rails to the bottom of the L3 magnet
- gMC->Gspos("LCPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ;
+ par[0] = geom->GetRailRoadSize(0) / 2.0 ;
+ par[1] = geom->GetRailRoadSize(1) / 2.0 ;
+ par[2] = geom->GetRailRoadSize(2) / 2.0 ;
+ TVirtualMC::GetMC()->Gsvolu("PRRD", "BOX ", idtmed[798], par, 3) ;
- // 3. Lower air gap
+ y0 = -(geom->GetRailsDistanceFromIP() - geom->GetRailRoadSize(1) / 2.0) ;
+ TVirtualMC::GetMC()->Gspos("PRRD", 1, "ALIC", 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 ;
+ // --- Dummy box containing one 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->GetRailOuterSize(0) / 2.0 ;
+ par[1] = geom->GetRailOuterSize(1) / 2.0 ;
+ par[2] = geom->GetRailOuterSize(2) / 2.0 ;
+ TVirtualMC::GetMC()->Gsvolu("PRAI", "BOX ", idtmed[798], par, 3) ;
-//___________________________________________________________________________
-Int_t AliPHOSv0::Digitize(Float_t Energy)
-{
- // Applies the energy calibration
-
- Float_t fB = 100000000. ;
- Float_t fA = 0. ;
- Int_t chan = Int_t(fA + Energy*fB ) ;
- return chan ;
-}
+ for (i=0; i<2; i++) {
+ x0 = (2*i-1) * geom->GetDistanceBetwRails() / 2.0 ;
+ TVirtualMC::GetMC()->Gspos("PRAI", i, "PRRD", x0, 0.0, 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
+ // --- Upper and bottom steel parts of the rail
- // Save the cumulated hits instead of raw hits (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.
-
-
- 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
+ par[0] = geom->GetRailPart1(0) / 2.0 ;
+ par[1] = geom->GetRailPart1(1) / 2.0 ;
+ par[2] = geom->GetRailPart1(2) / 2.0 ;
+ TVirtualMC::GetMC()->Gsvolu("PRP1", "BOX ", idtmed[716], par, 3) ;
- Float_t energyandnoise ;
- for ( i = 0 ; i < fNdigits ; i++ ) {
- newdigit = (AliPHOSDigit * ) fDigits->At(i) ;
- fGeom->AbsToRelNumbering(newdigit->GetId(), relid) ;
+ y0 = - (geom->GetRailOuterSize(1) - geom->GetRailPart1(1)) / 2.0 ;
+ TVirtualMC::GetMC()->Gspos("PRP1", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ;
+ y0 = (geom->GetRailOuterSize(1) - geom->GetRailPart1(1)) / 2.0 - geom->GetRailPart3(1);
+ TVirtualMC::GetMC()->Gspos("PRP1", 2, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ;
- if (relid[1]==0){ // Digits belong to EMC (PbW0_4 crystals)
- energyandnoise = newdigit->GetAmp() + Digitize(gRandom->Gaus(0., fPinElectronicNoise)) ;
+ // --- The middle vertical steel parts of the rail
- if (energyandnoise < 0 )
- energyandnoise = 0 ;
+ par[0] = geom->GetRailPart2(0) / 2.0 ;
+ par[1] = geom->GetRailPart2(1) / 2.0 ;
+ par[2] = geom->GetRailPart2(2) / 2.0 ;
+ TVirtualMC::GetMC()->Gsvolu("PRP2", "BOX ", idtmed[716], par, 3) ;
- if ( newdigit->GetAmp() < fDigitThreshold ) // if threshold not surpassed, remove digit from list
- fDigits->RemoveAt(i) ;
- }
- }
-
- fDigits->Compress() ;
+ y0 = - geom->GetRailPart3(1) / 2.0 ;
+ TVirtualMC::GetMC()->Gspos("PRP2", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ;
- fNdigits = fDigits->GetEntries() ;
- for (i = 0 ; i < fNdigits ; i++) {
- newdigit = (AliPHOSDigit *) fDigits->At(i) ;
- newdigit->SetIndexInList(i) ;
- }
-
-}
+ // --- The most upper steel parts of the rail
-//____________________________________________________________________________
-void AliPHOSv0::Init(void)
-{
- // Just prints an information message
-
- Int_t i;
+ par[0] = geom->GetRailPart3(0) / 2.0 ;
+ par[1] = geom->GetRailPart3(1) / 2.0 ;
+ par[2] = geom->GetRailPart3(2) / 2.0 ;
+ TVirtualMC::GetMC()->Gsvolu("PRP3", "BOX ", idtmed[716], par, 3) ;
- printf("\n");
- for(i=0;i<35;i++) printf("*");
- printf(" PHOS_INIT ");
- for(i=0;i<35;i++) printf("*");
- printf("\n");
+ y0 = (geom->GetRailOuterSize(1) - geom->GetRailPart3(1)) / 2.0 ;
+ TVirtualMC::GetMC()->Gspos("PRP3", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ;
- // Here the PHOS initialisation code (if any!)
+ // --- The wall of the cradle
+ // --- The wall is empty: steel thin walls and air inside
- for(i=0;i<80;i++) printf("*");
- printf("\n");
-
-}
+ 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) ;
+ TVirtualMC::GetMC()->Gsvolu("PCRA", "TUBS", idtmed[716], par, 5) ;
-//___________________________________________________________________________
-void AliPHOSv0::MakeBranch(Option_t* opt)
-{
- // Create new branche in the current Root Tree in the digit Tree
+ par[0] += geom->GetCradleWallThickness() ;
+ par[1] -= geom->GetCradleWallThickness() ;
+ par[2] -= geom->GetCradleWallThickness() ;
+ TVirtualMC::GetMC()->Gsvolu("PCRE", "TUBS", idtmed[798], par, 5) ;
+ TVirtualMC::GetMC()->Gspos ("PCRE", 1, "PCRA", 0.0, 0.0, 0.0, 0, "ONLY") ;
- 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);
+ for (i=0; i<2; i++) {
+ z0 = (2*i-1) * (geom->GetOuterBoxSize(2) + geom->GetCradleWall(2) )/ 2.0 ;
+ TVirtualMC::GetMC()->Gspos("PCRA", i, "ALIC", 0.0, 0.0, z0, 0, "ONLY") ;
}
- // Create new branche PHOSCH in the current Root Tree in the digit Tree for accumulated Hits
- if ( ! (gAlice->IsLegoRun()) ) { // only when not in lego plot mode
- if ( fTmpHits && gAlice->TreeD() && cdD) {
- char branchname[10] ;
- sprintf(branchname, "%sCH", GetName()) ;
- gAlice->TreeD()->Branch(branchname, &fTmpHits, fBufferSize) ;
- }
+ // --- The "wheels" of the cradle
+
+ par[0] = geom->GetCradleWheel(0) / 2;
+ par[1] = geom->GetCradleWheel(1) / 2;
+ par[2] = geom->GetCradleWheel(2) / 2;
+ TVirtualMC::GetMC()->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 ;
+ TVirtualMC::GetMC()->Gspos("PWHE", copy, "ALIC", x0, y0, z0, 0, "ONLY") ;
+ }
}
}
-
//_____________________________________________________________________________
-void AliPHOSv0::Reconstruction(AliPHOSReconstructioner * Reconstructioner)
-{
- // 1. Reinitializes the existing RecPoint, TrackSegment, and RecParticles Lists and
- // 2. Creates TreeR with 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] ;
-
-
-
-
- // 1.
-
- // gAlice->MakeTree("R") ;
- Int_t splitlevel = 0 ;
-
- if (fEmcRecPoints) {
- fEmcRecPoints->Delete() ;
- delete fEmcRecPoints ;
- fEmcRecPoints = 0 ;
+void AliPHOSv0::AddAlignableVolumes() const
+{
+ //
+ // Create entries for alignable volumes associating the symbolic volume
+ // name with the corresponding volume path. Needs to be syncronized with
+ // eventual changes in the geometry
+ // Alignable volumes are:
+ // 1) PHOS modules as a whole
+ // 2) Cradle
+ // 3) Cradle wheels
+ // 4) Strip units (group of 2x8 crystals)
+
+ TString volpath, symname;
+
+ // Alignable modules
+ // Volume path /ALIC_1/PHOS_ => symbolic name /PHOS/Module, =1,2,3,4,5
+
+ AliGeomManager::ELayerID idPHOS1 = AliGeomManager::kPHOS1;
+ AliGeomManager::ELayerID idPHOS2 = AliGeomManager::kPHOS2;
+ Int_t modUID, modnum = 0;
+ TString physModulePath="/ALIC_1/PHOS_";
+ TString symbModuleName="PHOS/Module";
+ Int_t nModules = GetGeometry()->GetNModules();
+
+ char im[5] ;
+ for(Int_t iModule=1; iModule<=nModules; iModule++){
+ snprintf(im,5,"%d",iModule) ;
+ modUID = AliGeomManager::LayerToVolUID(idPHOS1,modnum++);
+ if(strstr(GetTitle(),im)==0 && strcmp(GetTitle(),"IHEP")!=0 && strcmp(GetTitle(),"noCPV")!=0)
+ continue ;
+ volpath = physModulePath;
+ volpath += iModule;
+ // volpath += "/PEMC_1/PCOL_1/PTIO_1/PCOR_1/PAGA_1/PTII_1";
+
+ // Check the volume path if not all 5 modules exist
+ if (!gGeoManager->CheckPath(volpath.Data())) {
+ AliError(Form("Volume path %s not valid!",volpath.Data()));
+ continue;
+ }
+
+ symname = symbModuleName;
+ symname += iModule;
+ if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
+ continue ;
+// AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
+
+ // Creates the Tracking to Local transformation matrix for PHOS modules
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID) ;
+
+ Float_t angle = GetGeometry()->GetPHOSAngle(iModule);
+ TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
+
+ TGeoHMatrix *matTtoL = new TGeoHMatrix;
+ matTtoL->RotateZ(-90.+angle);
+ matTtoL->MultiplyLeft(&(globMatrix->Inverse()));
+ alignableEntry->SetMatrix(matTtoL);
}
- // fEmcRecPoints= new AliPHOSRecPoint::RecPointsList("AliPHOSEmcRecPoint", 1000) ; if TClonesArray
- fEmcRecPoints= new AliPHOSRecPoint::RecPointsList(100) ;
+ //Aligning of CPV should be done for volume PCPV_1
+ symbModuleName="PHOS/Module";
+ modnum=0;
+ for(Int_t iModule=1; iModule<=nModules; iModule++){
+ if(strstr(GetTitle(),"noCPV"))
+ continue ;
+ snprintf(im,5,"%d",iModule) ;
+ modUID = AliGeomManager::LayerToVolUID(idPHOS2,modnum++);
+ if(strstr(GetTitle(),im)==0 && strcmp(GetTitle(),"IHEP")!=0)
+ continue ;
+ volpath = physModulePath;
+ volpath += iModule;
+ volpath += "/PCPV_1";
+ // Check the volume path
+ if (!gGeoManager->CheckPath(volpath.Data())) {
+ AliError(Form("Volume path %s not valid!",volpath.Data()));
+ continue;
+ }
- if ( fEmcRecPoints && gAlice->TreeR() ) {
- sprintf(branchname,"%sEmcRP",GetName()) ;
+ symname = symbModuleName;
+ symname += iModule;
+ symname += "/CPV";
+ if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
+ AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
+
+ // Creates the TGeo Local to Tracking transformation matrix ...
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID) ;
+
+ Float_t angle = GetGeometry()->GetPHOSAngle(iModule);
+ TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
+
+ TGeoHMatrix *matTtoL = new TGeoHMatrix;
+ matTtoL->RotateZ(-90.+angle);
+ matTtoL->MultiplyLeft(&(globMatrix->Inverse()));
+ alignableEntry->SetMatrix(matTtoL);
- // gAlice->TreeR()->Branch(branchname, &fEmcRecPoints, fBufferSize); if TClonesArray
- gAlice->TreeR()->Branch(branchname, "TObjArray", &fEmcRecPoints, fBufferSize, splitlevel) ;
}
+
- if (fPpsdRecPoints) {
- fPpsdRecPoints->Delete() ;
- delete fPpsdRecPoints ;
- fPpsdRecPoints = 0 ;
- }
+ // Alignable cradle walls
+ // Volume path /ALIC_1/PCRA_ => symbolic name /PHOS/Cradle, =0,1
- // fPpsdRecPoints = new AliPHOSRecPoint::RecPointsList("AliPHOSPpsdRecPoint", 1000) ; if TClonesArray
- fPpsdRecPoints = new AliPHOSRecPoint::RecPointsList(100) ;
+ TString physCradlePath="/ALIC_1/PCRA_";
+ TString symbCradleName="PHOS/Cradle";
+ Int_t nCradles = 2;
- if ( fPpsdRecPoints && gAlice->TreeR() ) {
- sprintf(branchname,"%sPpsdRP",GetName()) ;
-
- // gAlice->TreeR()->Branch(branchname, &fPpsdRecPoints, fBufferSize); if TClonesArray
- gAlice->TreeR()->Branch(branchname, "TObjArray", &fPpsdRecPoints, fBufferSize, splitlevel) ;
+ for(Int_t iCradle=0; iCradle