X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONResponseV0.cxx;h=f607ceb25a1bd638874eb433c9a5ac3bf928209c;hb=b056545117afec39125a0084d2c0d833bf270690;hp=1828361019df05e36c352dd70f4277dee072b513;hpb=d19b6003496911d8cd38801049a60dc29d1c4dba;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONResponseV0.cxx b/MUON/AliMUONResponseV0.cxx index 1828361019d..f607ceb25a1 100644 --- a/MUON/AliMUONResponseV0.cxx +++ b/MUON/AliMUONResponseV0.cxx @@ -15,33 +15,38 @@ /* $Id$ */ -// -------------------------- +//----------------------------------------------------------------------------- // Class AliMUONResponseV0 // -------------------------- -// Implementation of Mathieson response -// ... +// Implementation of +// Mathieson response +//----------------------------------------------------------------------------- #include "AliMUONResponseV0.h" - -#include "AliLog.h" #include "AliMUON.h" #include "AliMUONConstants.h" #include "AliMUONDigit.h" -#include "AliMUONGeometrySegmentation.h" #include "AliMUONGeometryTransformer.h" #include "AliMUONHit.h" -#include "AliMUONSegmentation.h" + #include "AliMpArea.h" #include "AliMpDEManager.h" #include "AliMpVPadIterator.h" +#include "AliMpSegmentation.h" #include "AliMpVSegmentation.h" +#include "AliMpCathodType.h" + #include "AliRun.h" +#include "AliLog.h" + #include "Riostream.h" #include "TVector2.h" #include #include +/// \cond CLASSIMP ClassImp(AliMUONResponseV0) +/// \endcond AliMUON* muon() { @@ -51,22 +56,16 @@ AliMUON* muon() void Global2Local(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg, Double_t& xl, Double_t& yl, Double_t& zl) { - // ideally should be : - // Double_t x,y,z; - // AliMUONGeometry::Global2Local(detElemId,xg,yg,zg,x,y,z); - // but while waiting for this geometry singleton, let's go through - // AliMUON still. + /// ideally should be : + /// Double_t x,y,z; + /// AliMUONGeometry::Global2Local(detElemId,xg,yg,zg,x,y,z); + /// but while waiting for this geometry singleton, let's go through + /// AliMUON still. const AliMUONGeometryTransformer* transformer = muon()->GetGeometryTransformer(); transformer->Global2Local(detElemId,xg,yg,zg,xl,yl,zl); } -AliMUONSegmentation* Segmentation() -{ - static AliMUONSegmentation* segmentation = muon()->GetSegmentation(); - return segmentation; -} - //__________________________________________________________________________ AliMUONResponseV0::AliMUONResponseV0() : AliMUONResponse(), @@ -75,93 +74,108 @@ AliMUONResponseV0::AliMUONResponseV0() fChargeSpreadY(0.0), fSigmaIntegration(0.0), fMaxAdc(0), + fSaturation(0), fZeroSuppression(0), fChargeCorrel(0.0), fMathieson(new AliMUONMathieson), - fChargeThreshold(1e-4) + fChargeThreshold(1e-4), + fIsTailEffect(kFALSE) { - // Normal constructor + /// Normal constructor AliDebug(1,Form("Default ctor")); } - //_________________________________________________________________________ -AliMUONResponseV0::AliMUONResponseV0(const AliMUONResponseV0& rhs) - : AliMUONResponse(rhs) +//__________________________________________________________________________ +AliMUONResponseV0::AliMUONResponseV0(const AliMUONResponseV0& other) +: AliMUONResponse(), +fChargeSlope(0.0), +fChargeSpreadX(0.0), +fChargeSpreadY(0.0), +fSigmaIntegration(0.0), +fMaxAdc(0), +fSaturation(0), +fZeroSuppression(0), +fChargeCorrel(0.0), +fMathieson(0), +fChargeThreshold(1e-4), +fIsTailEffect(kFALSE) { -// Protected copy constructor + /// copy ctor + other.CopyTo(*this); +} - AliFatal("Not implemented."); +//__________________________________________________________________________ +AliMUONResponseV0& +AliMUONResponseV0::operator=(const AliMUONResponseV0& other) +{ + /// Assignment operator + other.CopyTo(*this); + return *this; } - //__________________________________________________________________________ +//__________________________________________________________________________ AliMUONResponseV0::~AliMUONResponseV0() { +/// Destructor + AliDebug(1,""); delete fMathieson; } - //________________________________________________________________________ -AliMUONResponseV0& AliMUONResponseV0::operator = (const AliMUONResponseV0& rhs) +//______________________________________________________________________________ +void +AliMUONResponseV0::CopyTo(AliMUONResponseV0& other) const { -// Protected assignement operator - - if (this == &rhs) return *this; - - AliFatal("Not implemented."); - - return *this; + /// Copy *this to other + other.fChargeSlope=fChargeSlope; + other.fChargeSpreadX=fChargeSpreadX; + other.fChargeSpreadY=fChargeSpreadY; + other.fSigmaIntegration=fSigmaIntegration; + other.fMaxAdc=fMaxAdc; + other.fSaturation=fSaturation; + other.fZeroSuppression=fZeroSuppression; + other.fChargeCorrel=fChargeCorrel; + delete other.fMathieson; + other.fMathieson = new AliMUONMathieson(*fMathieson); + other.fChargeThreshold=fChargeThreshold; } //______________________________________________________________________________ void AliMUONResponseV0::Print(Option_t*) const { -// Printing +/// Printing cout << " ChargeSlope=" << fChargeSlope << " ChargeSpreadX,Y=" << fChargeSpreadX << fChargeSpreadY << " ChargeCorrelation=" << fChargeCorrel << endl; - -//Float_t fChargeSlope; // Slope of the charge distribution -//Float_t fChargeSpreadX; // Width of the charge distribution in x -//Float_t fChargeSpreadY; // Width of the charge distribution in y -//Float_t fSigmaIntegration; // Number of sigma's used for charge distribution -//Int_t fMaxAdc; // Maximum ADC channel -//Int_t fSaturation; // Pad saturation in ADC channel -//Int_t fZeroSuppression; // Zero suppression threshold -//Float_t fChargeCorrel; // amplitude of charge correlation on 2 cathods -// // is RMS of ln(q1/q2) -//AliMUONMathieson* fMathieson; // pointer to mathieson fct -//Float_t fChargeThreshold; // Charges below this threshold are = 0 -// - } //__________________________________________________________________________ void AliMUONResponseV0::SetSqrtKx3AndDeriveKx2Kx4(Float_t SqrtKx3) { - // Set to "SqrtKx3" the Mathieson parameter K3 ("fSqrtKx3") - // in the X direction, perpendicular to the wires, - // and derive the Mathieson parameters K2 ("fKx2") and K4 ("fKx4") - // in the same direction + /// Set to "SqrtKx3" the Mathieson parameter K3 ("fSqrtKx3") + /// in the X direction, perpendicular to the wires, + /// and derive the Mathieson parameters K2 ("fKx2") and K4 ("fKx4") + /// in the same direction fMathieson->SetSqrtKx3AndDeriveKx2Kx4(SqrtKx3); } //__________________________________________________________________________ void AliMUONResponseV0::SetSqrtKy3AndDeriveKy2Ky4(Float_t SqrtKy3) { - // Set to "SqrtKy3" the Mathieson parameter K3 ("fSqrtKy3") - // in the Y direction, along the wires, - // and derive the Mathieson parameters K2 ("fKy2") and K4 ("fKy4") - // in the same direction + /// Set to "SqrtKy3" the Mathieson parameter K3 ("fSqrtKy3") + /// in the Y direction, along the wires, + /// and derive the Mathieson parameters K2 ("fKy2") and K4 ("fKy4") + /// in the same direction fMathieson->SetSqrtKy3AndDeriveKy2Ky4(SqrtKy3); } //__________________________________________________________________________ -Float_t AliMUONResponseV0::IntPH(Float_t eloss) +Float_t AliMUONResponseV0::IntPH(Float_t eloss) const { - // Calculate charge from given ionization energy loss + /// Calculate charge from given ionization energy loss Int_t nel; nel= Int_t(eloss*1.e9/27.4); Float_t charge=0; @@ -174,47 +188,12 @@ Float_t AliMUONResponseV0::IntPH(Float_t eloss) return charge; } - //------------------------------------------- -Float_t AliMUONResponseV0::IntXY(Int_t idDE, AliMUONGeometrySegmentation* segmentation) -{ - // Calculate charge on current pad according to Mathieson distribution - - return fMathieson->IntXY(idDE, segmentation); -} - - - //------------------------------------------- -Int_t AliMUONResponseV0::DigitResponse(Int_t digit, AliMUONTransientDigit* /*where*/) -{ - // \deprecated method - // Now part of the digitizer (where it belongs really), e.g. DigitizerV3 - // - // add white noise and do zero-suppression and signal truncation - - // Float_t meanNoise = gRandom->Gaus(1, 0.2); - // correct noise for slat chambers; - // one more field to add to AliMUONResponseV0 to allow different noises ???? -// Float_t meanNoise = gRandom->Gaus(1., 0.2); -// Float_t noise = gRandom->Gaus(0., meanNoise); - Float_t noise = gRandom->Gaus(0., 1.0); - digit += TMath::Nint(noise); - if ( digit <= ZeroSuppression()) digit = 0; - // if ( digit > MaxAdc()) digit=MaxAdc(); - if ( digit > Saturation()) - { - digit=Saturation(); - } - - return digit; -} - //_____________________________________________________________________________ Float_t AliMUONResponseV0::GetAnod(Float_t x) const { - // - // Return wire coordinate closest to x. - // + /// Return wire coordinate closest to x. + Int_t n = Int_t(x/Pitch()); Float_t wire = (x>0) ? n+0.5 : n-0.5; return Pitch()*wire; @@ -224,25 +203,62 @@ AliMUONResponseV0::GetAnod(Float_t x) const void AliMUONResponseV0::DisIntegrate(const AliMUONHit& hit, TList& digits) { - // - // Go from 1 hit to a list of digits. - // The energy deposition of that hit is first converted into charge - // (in IntPH() method), and then this charge is dispatched on several - // pads, according to the Mathieson distribution. - // + /// Go from 1 hit to a list of digits. + /// The energy deposition of that hit is first converted into charge + /// (in IntPH() method), and then this charge is dispatched on several + /// pads, according to the Mathieson distribution. digits.Clear(); Int_t detElemId = hit.DetElemId(); - + Double_t hitX = hit.X() ; + Double_t hitY = hit.Y() ; + Double_t hitZ = hit.Z() ; + // Width of the integration area Double_t dx = SigmaIntegration()*ChargeSpreadX(); Double_t dy = SigmaIntegration()*ChargeSpreadY(); + //Modify to take the tailing effect. + if(fIsTailEffect){ + Double_t locX,locY,locZ,globXCenter,globYCenter,globZ; + Int_t para = 5; // This parameter is a natural number(excluding zero and four), higher the value less is the tailing effect + Double_t termA = 1.0; + Double_t termB = 1.0; + if(para>0){ + for ( Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath ) + { + // Get an iterator to loop over pads, within the given area. + const AliMpVSegmentation* seg = + AliMpSegmentation::Instance() + ->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath)); + AliMp::PlaneType plane = seg->PlaneType(); + + if(plane == AliMp::kBendingPlane) { + Global2Local(detElemId,hitX,hitY,hitZ,locX,locY,locZ); + TVector2 hitPoint(locX,locY); + AliMpPad pad = seg->PadByPosition(hitPoint,kFALSE); + Double_t locYCenter = pad.Position().Y(); + Double_t locXCenter = pad.Position().X(); + const AliMUONGeometryTransformer* transformer = muon()->GetGeometryTransformer(); + transformer->Local2Global(detElemId,locXCenter,locYCenter,locZ,globXCenter,globYCenter,globZ); + for(Int_t itime = 0; itime 0 condn + }// if tail effect + // Use that (dx,dy) to specify the area upon which // we will iterate to spread charge into. Double_t x,y,z; - Global2Local(detElemId,hit.X(),hit.Y(),hit.Z(),x,y,z); + Global2Local(detElemId,hitX,hitY,hitZ,x,y,z); x = GetAnod(x); TVector2 hitPosition(x,y); AliMpArea area(hitPosition,TVector2(dx,dy)); @@ -253,13 +269,14 @@ AliMUONResponseV0::DisIntegrate(const AliMUONHit& hit, TList& digits) // Get the charge correlation between cathodes. Float_t currentCorrel = TMath::Exp(gRandom->Gaus(0.0,ChargeCorrel()/2.0)); - for ( Int_t cath = 0; cath < 2; ++cath ) + for ( Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath ) { Float_t qcath = qtot * ( cath == 0 ? currentCorrel : 1.0/currentCorrel); // Get an iterator to loop over pads, within the given area. const AliMpVSegmentation* seg = - Segmentation()->GetMpSegmentation(detElemId,cath); + AliMpSegmentation::Instance() + ->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath)); AliMpVPadIterator* it = seg->CreateIterator(area); @@ -310,15 +327,10 @@ AliMUONResponseV0::DisIntegrate(const AliMUONHit& hit, TList& digits) { // If we're above threshold, then we create a digit, // and fill it with relevant information, including electronics. - AliMUONDigit* d = new AliMUONDigit; - d->SetDetElemId(detElemId); - d->SetPadX(pad.GetIndices().GetFirst()); - d->SetPadY(pad.GetIndices().GetSecond()); - d->SetSignal(icharge); - d->AddPhysicsSignal(d->Signal()); - d->SetCathode(cath); - d->SetElectronics(pad.GetLocation().GetFirst(), - pad.GetLocation().GetSecond()); + AliMUONDigit* d = new AliMUONDigit(detElemId,pad.GetLocation().GetFirst(), + pad.GetLocation().GetSecond(),cath); + d->SetPadXY(pad.GetIndices().GetFirst(),pad.GetIndices().GetSecond()); + d->SetCharge(icharge); digits.Add(d); } it->Next();