X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONResponseV0.cxx;h=5bc82aea728017280d5d068f973aa26f4de1f086;hb=2c595ef574fcac26dbafa56453bbb2202b68ef47;hp=78b04a1f7b4e26e905adab459e2ac042a0a76922;hpb=5fe364814bd3d073842daa38ca50d5f8681292e1;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONResponseV0.cxx b/MUON/AliMUONResponseV0.cxx index 78b04a1f7b4..5bc82aea728 100644 --- a/MUON/AliMUONResponseV0.cxx +++ b/MUON/AliMUONResponseV0.cxx @@ -28,6 +28,7 @@ #include "AliMUONDigit.h" #include "AliMUONGeometryTransformer.h" #include "AliMUONHit.h" +#include "AliMUONConstants.h" #include "AliMpArea.h" #include "AliMpDEManager.h" @@ -44,6 +45,8 @@ #include #include +using std::endl; +using std::cout; /// \cond CLASSIMP ClassImp(AliMUONResponseV0) /// \endcond @@ -201,7 +204,7 @@ AliMUONResponseV0::GetAnod(Float_t x) const //______________________________________________________________________________ void -AliMUONResponseV0::DisIntegrate(const AliMUONHit& hit, TList& digits) +AliMUONResponseV0::DisIntegrate(const AliMUONHit& hit, TList& digits, Float_t timeDif) { /// Go from 1 hit to a list of digits. /// The energy deposition of that hit is first converted into charge @@ -236,11 +239,10 @@ AliMUONResponseV0::DisIntegrate(const AliMUONHit& hit, TList& digits) if(plane == AliMp::kBendingPlane) { Global2Local(detElemId,hitX,hitY,hitZ,locX,locY,locZ); - TVector2 hitPoint(locX,locY); - AliMpPad pad = seg->PadByPosition(hitPoint,kFALSE); + AliMpPad pad = seg->PadByPosition(locX,locY,kFALSE); if(pad.IsValid()){ - Double_t locYCenter = pad.Position().Y(); - Double_t locXCenter = pad.Position().X(); + Double_t locYCenter = pad.GetPositionY(); + Double_t locXCenter = pad.GetPositionX(); const AliMUONGeometryTransformer* transformer = muon()->GetGeometryTransformer(); transformer->Local2Global(detElemId,locXCenter,locYCenter,locZ,globXCenter,globYCenter,globZ); for(Int_t itime = 0; itimeGaus(0.0,ChargeCorrel()/2.0)); @@ -293,20 +302,21 @@ AliMUONResponseV0::DisIntegrate(const AliMUONHit& hit, TList& digits) if ( it->IsDone() ) { // Exceptional case : iterator is built, but is invalid from the start. - AliMpPad pad = seg->PadByPosition(area.Position(),kFALSE); + AliMpPad pad = seg->PadByPosition(area.GetPositionX(),area.GetPositionY(), + kFALSE); if ( pad.IsValid() ) { - AliWarning(Form("Got an invalid iterator bug (area.Position() is within " + AliDebug(1, Form("Got an invalid iterator bug (area.Position() is within " " DE but the iterator is void) for detElemId %d cath %d", detElemId,cath)); } else { - AliError(Form("Got an invalid iterator bug for detElemId %d cath %d." + AliDebug(1, Form("Got an invalid iterator bug for detElemId %d cath %d." "Might be a bad hit ? area.Position()=(%e,%e) " "Dimensions()=(%e,%e)", - detElemId,cath,area.Position().X(),area.Position().Y(), - area.Dimensions().X(),area.Dimensions().Y())); + detElemId,cath,area.GetPositionX(),area.GetPositionY(), + area.GetDimensionX(),area.GetDimensionY())); } delete it; return; @@ -317,21 +327,25 @@ AliMUONResponseV0::DisIntegrate(const AliMUONHit& hit, TList& digits) // For each pad given by the iterator, compute the charge of that // pad, according to the Mathieson distribution. AliMpPad pad = it->CurrentItem(); - TVector2 lowerLeft(hitPosition-pad.Position()-pad.Dimensions()); - TVector2 upperRight(lowerLeft + pad.Dimensions()*2.0); + TVector2 lowerLeft(TVector2(x,y)-TVector2(pad.GetPositionX(),pad.GetPositionY())- + TVector2(pad.GetDimensionX(),pad.GetDimensionY())); + TVector2 upperRight(lowerLeft + TVector2(pad.GetDimensionX(),pad.GetDimensionY())*2.0); Float_t qp = TMath::Abs(fMathieson->IntXY(lowerLeft.X(),lowerLeft.Y(), upperRight.X(),upperRight.Y())); - Int_t icharge = Int_t(qp*qcath); - - if ( qp > fChargeThreshold ) + if ( qp > fChargeThreshold && + qp*qcath > AliMUONConstants::DefaultADC2MV()*AliMUONConstants::DefaultA0()*AliMUONConstants::DefaultCapa() ) { // If we're above threshold, then we create a digit, // and fill it with relevant information, including electronics. - AliMUONDigit* d = new AliMUONDigit(detElemId,pad.GetLocation().GetFirst(), - pad.GetLocation().GetSecond(),cath); - d->SetPadXY(pad.GetIndices().GetFirst(),pad.GetIndices().GetSecond()); - d->SetCharge(icharge); + + // note that the second condition above is to be backward compatible (when + // the sdigitizer was making a cut on Int_t(qp*qcath) > 0 and qcath was in ADC, not in fC) + + AliMUONDigit* d = new AliMUONDigit(detElemId,pad.GetManuId(), + pad.GetManuChannel(),cath); + d->SetPadXY(pad.GetIx(),pad.GetIy()); + d->SetCharge(qp*qcath); digits.Add(d); } it->Next();