X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=FMD%2FAliFMDv1.cxx;h=386115768af1796f25089eb21ebb0a78d6fabf5b;hb=174de2fdb238a1028cf8592007ba4161f535745a;hp=f7aeb7aec4ff34e365b4683cf5f4417c62649bb0;hpb=c2fc12580f7bb903a1f061ae3d60882098e8a988;p=u%2Fmrichter%2FAliRoot.git diff --git a/FMD/AliFMDv1.cxx b/FMD/AliFMDv1.cxx index f7aeb7aec4f..386115768af 100644 --- a/FMD/AliFMDv1.cxx +++ b/FMD/AliFMDv1.cxx @@ -18,6 +18,7 @@ @date Mon Mar 27 12:48:51 2006 @brief Concrete implementation of FMD detector driver - detailed version + @ingroup FMD_sim */ //____________________________________________________________________ // @@ -25,7 +26,6 @@ // contains the base procedures for the Forward Multiplicity detector // Detector consists of 3 sub-detectors FMD1, FMD2, and FMD3, each of // which has 1 or 2 rings of silicon sensors. -// // This class contains the detailed version of the FMD - that is, hits // are produced during simulation. // @@ -35,9 +35,10 @@ #include // ROOT_TVirtualMC #include // ALIRUN_H #include // ALIMC_H -#include // ALILOG_H +// #include // ALILOG_H +#include "AliFMDDebug.h" // Better debug macros #include "AliFMDv1.h" // ALIFMDV1_H -#include "AliFMDGeometryBuilder.h" +// #include "AliFMDGeometryBuilder.h" #include "AliFMDGeometry.h" #include "AliFMDDetector.h" #include "AliFMDRing.h" @@ -57,7 +58,8 @@ Bool_t AliFMDv1::VMC2FMD(TLorentzVector& v, UShort_t& detector, Char_t& ring, UShort_t& sector, UShort_t& strip) const { - TVirtualMC* mc = TVirtualMC::GetMC(); + // Convert VMC coordinates to detector coordinates + TVirtualMC* mc = TVirtualMC::GetMC(); AliFMDGeometry* fmd = AliFMDGeometry::Instance(); // Get track position @@ -90,7 +92,7 @@ AliFMDv1::VMC2FMD(TLorentzVector& v, UShort_t& detector, if (t < 0 || t > 2 * theta) return kFALSE; else if (t > theta) sector += 1; - AliDebug(40, Form("<1> Inside an active FMD volume FMD%d%c[%2d,%3d] %s", + AliFMDDebug(40, ("<1> Inside an active FMD volume FMD%d%c[%2d,%3d] %s", detector, ring, sector, strip, mc->CurrentVolPath())); return kTRUE; } @@ -101,7 +103,8 @@ AliFMDv1::VMC2FMD(Int_t copy, TLorentzVector& v, UShort_t& detector, Char_t& ring, UShort_t& sector, UShort_t& strip) const { - TVirtualMC* mc = TVirtualMC::GetMC(); + // Convert VMC coordinates to detector coordinates + TVirtualMC* mc = TVirtualMC::GetMC(); AliFMDGeometry* fmd = AliFMDGeometry::Instance(); strip = copy - 1; @@ -112,7 +115,7 @@ AliFMDv1::VMC2FMD(Int_t copy, TLorentzVector& v, } else sector = sectordiv; - AliDebug(30, Form("Getting ring volume with offset %d -> %s", + AliFMDDebug(30, ("Getting ring volume with offset %d -> %s", fmd->GetRingOff(), mc->CurrentVolOffName(fmd->GetRingOff()))); Int_t iring; mc->CurrentVolOffID(fmd->GetRingOff(), iring); @@ -125,15 +128,16 @@ AliFMDv1::VMC2FMD(Int_t copy, TLorentzVector& v, AliFMDRing* gring = gdet->GetRing(ring); if (!gring) { AliFatal(Form("Ring %c not found (volume was %s at offset %d in path %s)", - ring, fmd->GetRingOff(), + ring, mc->CurrentVolOffName(fmd->GetRingOff()), + fmd->GetRingOff(), mc->CurrentVolPath())); } Int_t n = gring->GetNSectors(); #if 0 if (rz < 0) { Int_t s = ((n - sector + n / 2) % n) + 1; - AliDebug(1, Form("Recalculating sector to %d (=%d-%d+%d/2%%%d+1 z=%f)", + AliFMDDebug(1, ("Recalculating sector to %d (=%d-%d+%d/2%%%d+1 z=%f)", s, n, sector, n, n, rz)); sector = s; } @@ -145,7 +149,7 @@ AliFMDv1::VMC2FMD(Int_t copy, TLorentzVector& v, sector--; // Get track position mc->TrackPosition(v); - AliDebug(15, Form("<2> Inside an active FMD volume FMD%d%c[%2d,%3d] %s", + AliFMDDebug(40, ("<2> Inside an active FMD volume FMD%d%c[%2d,%3d] %s", detector, ring, sector, strip, mc->CurrentVolPath())); return kTRUE; @@ -157,6 +161,7 @@ Bool_t AliFMDv1::CheckHit(Int_t trackno, Int_t pdg, Float_t absQ, const TLorentzVector& p, Float_t edep) const { + // Check that a hit is good if (AliLog::GetDebugLevel("FMD", "AliFMD") < 5) return kFALSE; TVirtualMC* mc = TVirtualMC::GetMC(); Double_t mass = mc->TrackMass(); @@ -188,7 +193,7 @@ AliFMDv1::CheckHit(Int_t trackno, Int_t pdg, Float_t absQ, if (mc->IsTrackOut()) what.Append("out "); Int_t mother = gAlice->GetMCApp()->GetPrimary(trackno); - AliDebug(15, Form("Track # %5d deposits a lot of energy\n" + AliFMDDebug(15, ("Track # %5d deposits a lot of energy\n" " Volume: %s\n" " Momentum: (%7.4f,%7.4f,%7.4f)\n" " PDG: %d (%s)\n" @@ -246,7 +251,7 @@ AliFMDv1::StepManager() Int_t vol = mc->CurrentVolID(copy); AliFMDGeometry* fmd = AliFMDGeometry::Instance(); if (!fmd->IsActive(vol)) { - AliDebug(50, Form("Not an FMD volume %d '%s'",vol,mc->CurrentVolName())); + AliFMDDebug(50, ("Not an FMD volume %d '%s'",vol,mc->CurrentVolName())); return; } TLorentzVector v; @@ -275,7 +280,7 @@ AliFMDv1::StepManager() // Reset the energy deposition for this track, and update some of // our parameters. if (entering) { - AliDebug(15, Form("Track # %8d entering active FMD volume %s: " + AliFMDDebug(15, ("Track # %8d entering active FMD volume %s: " "Edep=%f (%f,%f,%f)", trackno, mc->CurrentVolPath(), edep, v.X(), v.Y(), v.Z())); fCurrentP = p; @@ -286,7 +291,7 @@ AliFMDv1::StepManager() // If the track is inside, then update the energy deposition if (inside && fCurrentDeltaE >= 0) { fCurrentDeltaE += edep; - AliDebug(15, Form("Track # %8d inside active FMD volume %s: Edep=%f, " + AliFMDDebug(15, ("Track # %8d inside active FMD volume %s: Edep=%f, " "Accumulated Edep=%f (%f,%f,%f)", trackno, mc->CurrentVolPath(), edep, fCurrentDeltaE, v.X(), v.Y(), v.Z())); @@ -297,7 +302,7 @@ AliFMDv1::StepManager() if (out) { if (fCurrentDeltaE >= 0) { fCurrentDeltaE += edep; - AliDebug(15, Form("Track # %8d exiting active FMD volume %s: Edep=%g, " + AliFMDDebug(15, ("Track # %8d exiting active FMD volume %s: Edep=%g, " "Accumulated Edep=%g (%f,%f,%f)", trackno, mc->CurrentVolPath(), edep, fCurrentDeltaE, v.X(), v.Y(), v.Z())); @@ -318,7 +323,7 @@ AliFMDv1::StepManager() #ifdef CHECK_TRANS Double_t x, y, z; fmd->Detector2XYZ(detector, ring, sector, strip, x, y ,z); - AliDebug(1, Form("Hit at (%f,%f,%f), geometry says (%f,%f,%f)", + AliFMDDebug(1, ("Hit at (%f,%f,%f), geometry says (%f,%f,%f)", fCurrentV.X(), fCurrentV.Y(), fCurrentV.Z(), x, y, z)); #endif }