X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONResponseTrigger.cxx;h=72af7cb0456314a54eb9aec8d53c4a1e8cfcb2ec;hb=eca9691564ac9a81669c84b207acc5d6566765b6;hp=d1bb2f9af376ecf20fd55bc14036b37a334ed80f;hpb=a30a000fda6ccf10620ecf96d42273b8ab83723b;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONResponseTrigger.cxx b/MUON/AliMUONResponseTrigger.cxx index d1bb2f9af37..72af7cb0456 100644 --- a/MUON/AliMUONResponseTrigger.cxx +++ b/MUON/AliMUONResponseTrigger.cxx @@ -13,85 +13,161 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.2 2000/06/15 07:58:48 morsch -Code from MUON-dev joined +/* $Id$ */ -Revision 1.1.2.1 2000/06/09 21:48:28 morsch -Code from AliMUONSegResTrigger.cxx +// ------------------------------- +// Class AliMUONResponseTrigger +// ------------------------------- +// Implementation +// of RPC response -*/ #include "AliMUONResponseTrigger.h" -#include "AliSegmentation.h" -#include -#include -#include - - +#include "AliMUON.h" +#include "AliMUONDigit.h" +#include "AliMUONGeometryTransformer.h" +#include "AliMUONHit.h" +#include "AliMUONSegmentation.h" +#include "AliMUONTriggerSegmentation.h" +#include "AliMUONConstants.h" + +#include "AliMpPad.h" +#include "AliMpCathodType.h" +#include "AliMpPlaneType.h" +#include "AliMpSegmentation.h" +#include "AliMpVSegmentation.h" + +#include "AliRun.h" +#include "AliLog.h" +#include "TList.h" + +/// \cond CLASSIMP ClassImp(AliMUONResponseTrigger) +/// \endcond -//------------------------------------------------------------------ -Float_t AliMUONResponseTrigger::IntXY(AliSegmentation * segmentation){ -// Returns 1 or 0 if the current strip is fired or not according -// to the cluster size and the width of the main strip. -// For the time being the probability to fire a neighbour depends -// only on the width of the main strip and is limited to a maximum -// cluster-size of 2. -// The corresponding probabilities are given below (O.Roig PhD Thesis) -// This will be improved in the future by including a parametrization -// of the cluster size as a function of the position of the physical -// hit with respect to the center of the strip. -//------------------------------------------------------------------ -// clust. size = 1 2 3 4 5 >5 -// strip width = 1 | 54.7 | 44.5 | 0.7 | 0.06 | 0.04 | 0.0 | -// strip width = 2 | 89.0 | 10.7 | 0.2 | 0.1 | 0.0 | 0.0 | -// strip width = 4 | 99.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | -//------------------------------------------------------------------ - -// cout << "in AliMUONResponseTrigger::IntXY" << "\n"; - - // get the "parameters" needed to evaluate the strip response - // x1 : hit x(y) position - // x2 : x(y) coordinate of the main strip - // x3 : current strip real x(y) coordinate - // width : width of the main strip - Float_t x1,x2,x3,width; - segmentation->IntegrationLimits(x1,x2,x3,width); - // cout << " x or y main & current = " << x2 << " , " << x3 - // << " width main = " << width << "\n"; - - /* - if (TMath::Abs(x3-x1)Rndm()*100.; - if (iwidth==1) { - if (rand<44.5) { return 1.; } - else { return 0.; } - } else if (iwidth==2) { - if (rand<10.7) { return 1.; } - else { return 0.; } - } else if (iwidth==4) { - if (rand<1.) { return 1.; } - else { return 0.; } - } - } else { return 0.;} - return -1; - */ - return 0; +namespace +{ + AliMUON* muon() + { + return static_cast(gAlice->GetModule("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. + + const AliMUONGeometryTransformer* transformer = muon()->GetGeometryTransformer(); + transformer->Global2Local(detElemId,xg,yg,zg,xl,yl,zl); + } + + AliMUONSegmentation* Segmentation() + { + static AliMUONSegmentation* segmentation = muon()->GetSegmentation(); + return segmentation; + } } +//------------------------------------------------------------------ +AliMUONResponseTrigger::AliMUONResponseTrigger() + : AliMUONResponse() +{ +/// Default constructor +} //------------------------------------------------------------------ -Int_t AliMUONResponseTrigger::DigitResponse(Int_t digit) +AliMUONResponseTrigger::~AliMUONResponseTrigger() { -// -// only digital (0/1) information available - if (digit) digit=1; - return digit; +/// Destructor } +//_____________________________________________________________________________ +void +AliMUONResponseTrigger::DisIntegrate(const AliMUONHit& hit, TList& digits) +{ + /// Generate 2 digits (one on each cathode) from 1 hit, i.e. no cluster-size + /// generation (simplest response case). + + digits.Clear(); + + Float_t xhit = hit.X(); + Float_t yhit = hit.Y(); + Float_t zhit = 0; // FIXME : should it be hit.Z() ? + Int_t detElemId = hit.DetElemId(); + + Double_t x,y,z; + Global2Local(detElemId,xhit,yhit,zhit,x,y,z); + + Float_t tof = hit.Age(); + Int_t twentyNano(100); + if (tofGetMpSegmentation(detElemId,AliMp::GetCathodType(cath)); + + AliMpPad pad = seg->PadByPosition(TVector2(x,y),kFALSE); + Int_t ix = pad.GetIndices().GetFirst(); + Int_t iy = pad.GetIndices().GetSecond(); + + AliDebug(1,Form("xhit,yhit=%e,%e lx,ly,lz=%e,%e,%e ix,iy=%d,%d", + xhit,yhit,x,y,z,ix,iy)); + + if ( !pad.IsValid() ) + { + AliWarning(Form("hit w/o strip %d-%d xhit,yhit=%e,%e local x,y,z " + "%e,%e,%e ix,iy=%d,%d",detElemId, + cath, + xhit,yhit,x,y,z,ix,iy)); + continue; + } + AliMUONDigit* d = new AliMUONDigit; + d->SetDetElemId(detElemId); +/* pc 09/02/06 no need for that anymore : trigger is in local numbering + + //FIXME: >> the following code to get the ixGlo and iyGlo is a bad hack + // because trigger has not yet switched to local numbering of its indices ! + // We should be able to use directly the (local) ix,iy from the pad ! + const AliMUONTriggerSegmentationV2* old = + dynamic_cast + (Segmentation()->GetDESegmentation(detElemId,cath)); + if ( !old ) + { + AliFatal("Got a wrong TriggerSegmentation object! Check that!"); + } + Int_t ixGlo; + Int_t iyGlo; + old->ILoc2IGlo(ix,iy,ixGlo,iyGlo); + if ( xhit < 0 ) ixGlo = -ixGlo; + // << end of bad hack. + d->SetPadX(ixGlo); + d->SetPadY(iyGlo); +*/ + d->SetPadX(ix); + d->SetPadY(iy); + + d->SetSignal(twentyNano); + d->AddPhysicsSignal(d->Signal()); + d->SetCathode(cath); + digits.Add(d); + // AliDebug(1,Form("Adding digit DE %d Cathode %d (%d,%d) signal %d", +// detElemId,cath,ixGlo,iyGlo,twentyNano)); + } + +// StdoutToAliDebug(1,digits.Print();); +// AliDebug(1,Form("Number of digits for detelem %d track %d : %d", +// hit.DetElemId(),hit.Track(),digits.GetSize())); +// +}