1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
19 #include "AliMUONResponseTrigger.h"
23 #include "AliMUONDigit.h"
24 #include "AliMUONGeometryTransformer.h"
25 #include "AliMUONHit.h"
26 #include "AliMUONSegmentation.h"
28 #include "AliMpPlaneType.h"
29 #include "AliMpVSegmentation.h"
32 #include "AliMUONTriggerSegmentationV2.h"
34 ClassImp(AliMUONResponseTrigger)
40 return static_cast<AliMUON*>(gAlice->GetModule("MUON"));
43 void Global2Local(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg,
44 Double_t& xl, Double_t& yl, Double_t& zl)
46 // ideally should be :
48 // AliMUONGeometry::Global2Local(detElemId,xg,yg,zg,x,y,z);
49 // but while waiting for this geometry singleton, let's go through
52 const AliMUONGeometryTransformer* transformer = muon()->GetGeometryTransformer();
53 transformer->Global2Local(detElemId,xg,yg,zg,xl,yl,zl);
56 AliMUONSegmentation* Segmentation()
58 static AliMUONSegmentation* segmentation = muon()->GetSegmentation();
64 AliMUONResponseTrigger::fgkTofLimit = 75E-9;
66 //------------------------------------------------------------------
67 AliMUONResponseTrigger::AliMUONResponseTrigger()
70 // Default constructor
73 //------------------------------------------------------------------
74 Int_t AliMUONResponseTrigger::DigitResponse(Int_t digit,
75 AliMUONTransientDigit* /*where*/) const
77 // only digital (0/1) information available
87 //_____________________________________________________________________________
89 AliMUONResponseTrigger::DisIntegrate(const AliMUONHit& hit, TList& digits)
92 // Generate 2 digits (one on each cathode) from 1 hit, i.e. no cluster-size
93 // generation (simplest response case).
98 Float_t xhit = hit.X();
99 Float_t yhit = hit.Y();
100 Float_t zhit = 0; // FIXME : should it be hit.Z() ?
101 Int_t detElemId = hit.DetElemId();
104 Global2Local(detElemId,xhit,yhit,zhit,x,y,z);
106 Float_t tof = hit.Age();
107 Int_t twentyNano(100);
113 for ( Int_t cath = 0; cath < 2; ++cath )
115 const AliMpVSegmentation* seg = Segmentation()->GetMpSegmentation(detElemId,cath);
117 AliMpPad pad = seg->PadByPosition(TVector2(x,y),kFALSE);
118 Int_t ix = pad.GetIndices().GetFirst();
119 Int_t iy = pad.GetIndices().GetSecond();
121 AliDebug(1,Form("xhit,yhit=%e,%e lx,ly,lz=%e,%e,%e ix,iy=%d,%d",
122 xhit,yhit,x,y,z,ix,iy));
124 if ( !pad.IsValid() )
126 AliWarning(Form("hit w/o strip %d-%d xhit,yhit=%e,%e local x,y,z "
127 "%e,%e,%e ix,iy=%d,%d",detElemId,
129 xhit,yhit,x,y,z,ix,iy));
132 AliMUONDigit* d = new AliMUONDigit;
133 d->SetDetElemId(detElemId);
134 /* pc 09/02/06 no need for that anymore : trigger is in local numbering
136 //FIXME: >> the following code to get the ixGlo and iyGlo is a bad hack
137 // because trigger has not yet switched to local numbering of its indices !
138 // We should be able to use directly the (local) ix,iy from the pad !
139 const AliMUONTriggerSegmentationV2* old =
140 dynamic_cast<const AliMUONTriggerSegmentationV2*>
141 (Segmentation()->GetDESegmentation(detElemId,cath));
144 AliFatal("Got a wrong TriggerSegmentation object! Check that!");
148 old->ILoc2IGlo(ix,iy,ixGlo,iyGlo);
149 if ( xhit < 0 ) ixGlo = -ixGlo;
150 // << end of bad hack.
157 d->SetSignal(twentyNano);
158 d->AddPhysicsSignal(d->Signal());
161 // AliDebug(1,Form("Adding digit DE %d Cathode %d (%d,%d) signal %d",
162 // detElemId,cath,ixGlo,iyGlo,twentyNano));
165 // StdoutToAliDebug(1,digits.Print(););
166 // AliDebug(1,Form("Number of digits for detelem %d track %d : %d",
167 // hit.DetElemId(),hit.Track(),digits.GetSize()));