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 //-----------------------------------------------------------------------------
20 // Class AliMUONResponseTrigger
21 // -------------------------------
24 //-----------------------------------------------------------------------------
27 #include "AliMUONResponseTrigger.h"
29 #include "AliMUONDigit.h"
30 #include "AliMUONGeometryTransformer.h"
31 #include "AliMUONHit.h"
32 #include "AliMUONConstants.h"
33 #include "AliMUONTriggerEfficiencyCells.h"
36 #include "AliMpCathodType.h"
37 #include "AliMpPlaneType.h"
38 #include "AliMpSegmentation.h"
39 #include "AliMpVSegmentation.h"
46 ClassImp(AliMUONResponseTrigger)
53 return static_cast<AliMUON*>(gAlice->GetModule("MUON"));
56 void Global2Local(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg,
57 Double_t& xl, Double_t& yl, Double_t& zl)
59 // ideally should be :
61 // AliMUONGeometry::Global2Local(detElemId,xg,yg,zg,x,y,z);
62 // but while waiting for this geometry singleton, let's go through
65 const AliMUONGeometryTransformer* transformer = muon()->GetGeometryTransformer();
66 transformer->Global2Local(detElemId,xg,yg,zg,xl,yl,zl);
70 //------------------------------------------------------------------
71 AliMUONResponseTrigger::AliMUONResponseTrigger()
73 fTriggerEfficiency(0x0)
75 /// Default constructor
78 //------------------------------------------------------------------
79 AliMUONResponseTrigger::~AliMUONResponseTrigger()
84 //_____________________________________________________________________________
86 AliMUONResponseTrigger::DisIntegrate(const AliMUONHit& hit, TList& digits)
88 /// Generate 2 digits (one on each cathode) from 1 hit, i.e. no cluster-size
89 /// generation (simplest response case).
93 Float_t xhit = hit.X();
94 Float_t yhit = hit.Y();
95 Float_t zhit = 0; // FIXME : should it be hit.Z() ?
96 Int_t detElemId = hit.DetElemId();
99 Global2Local(detElemId,xhit,yhit,zhit,x,y,z);
101 Float_t tof = hit.Age();
102 Int_t twentyNano(100);
103 if (tof<AliMUONConstants::TriggerTofLimit())
108 Bool_t isTrig[2]={kTRUE,kTRUE};
110 for ( Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath )
112 const AliMpVSegmentation* seg
113 = AliMpSegmentation::Instance()
114 ->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
116 AliMpPad pad = seg->PadByPosition(TVector2(x,y),kFALSE);
117 Int_t ix = pad.GetIndices().GetFirst();
118 Int_t iy = pad.GetIndices().GetSecond();
120 AliDebug(1,Form("xhit,yhit=%e,%e lx,ly,lz=%e,%e,%e ix,iy=%d,%d",
121 xhit,yhit,x,y,z,ix,iy));
123 if ( !pad.IsValid() )
125 AliWarning(Form("hit w/o strip %d-%d xhit,yhit=%e,%e local x,y,z "
126 "%e,%e,%e ix,iy=%d,%d",detElemId,
128 xhit,yhit,x,y,z,ix,iy));
131 AliMUONDigit* d = new AliMUONDigit(detElemId,pad.GetLocation(0).GetFirst(),
132 pad.GetLocation(0).GetSecond(),cath);
135 //FIXME : a trigger digit can have several locations.
136 //this is not currently supported by the digit class. Change that or not ?
137 d->SetCharge(twentyNano);
139 if(fTriggerEfficiency){
141 Int_t nboard = pad.GetLocation(0).GetFirst();
142 fTriggerEfficiency->IsTriggered(detElemId, nboard,
143 isTrig[0], isTrig[1]);
145 if(!isTrig[cath]) continue;
154 //_____________________________________________________________________________
156 AliMUONResponseTrigger::InitTriggerEfficiency(AliMUONTriggerEfficiencyCells *triggerEfficiency)
158 /// Initialize trigger chamber efficiency (on demand)
160 fTriggerEfficiency = triggerEfficiency;
161 if ( fTriggerEfficiency )
163 AliDebug(1, "Will apply trigger efficiency");
167 AliFatal("I was requested to apply trigger efficiency, but I could "