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"
34 #include "AliMUONTriggerChamberEfficiency.h"
37 #include "AliMpCathodType.h"
38 #include "AliMpPlaneType.h"
39 #include "AliMpSegmentation.h"
40 #include "AliMpVSegmentation.h"
47 ClassImp(AliMUONResponseTrigger)
54 return static_cast<AliMUON*>(gAlice->GetModule("MUON"));
57 void Global2Local(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg,
58 Double_t& xl, Double_t& yl, Double_t& zl)
60 // ideally should be :
62 // AliMUONGeometry::Global2Local(detElemId,xg,yg,zg,x,y,z);
63 // but while waiting for this geometry singleton, let's go through
66 const AliMUONGeometryTransformer* transformer = muon()->GetGeometryTransformer();
67 transformer->Global2Local(detElemId,xg,yg,zg,xl,yl,zl);
71 //------------------------------------------------------------------
72 AliMUONResponseTrigger::AliMUONResponseTrigger()
74 fTriggerEfficiency(0x0)
76 /// Default constructor
79 //------------------------------------------------------------------
80 AliMUONResponseTrigger::~AliMUONResponseTrigger()
85 //_____________________________________________________________________________
87 AliMUONResponseTrigger::DisIntegrate(const AliMUONHit& hit, TList& digits, Float_t /*timeDif*/)
89 /// Generate 2 digits (one on each cathode) from 1 hit, i.e. no cluster-size
90 /// generation (simplest response case).
94 Float_t xhit = hit.X();
95 Float_t yhit = hit.Y();
96 Float_t zhit = hit.Z();
97 Int_t detElemId = hit.DetElemId();
100 Global2Local(detElemId,xhit,yhit,zhit,x,y,z);
102 Float_t tof = hit.Age();
103 Int_t twentyNano(100);
104 if (tof<AliMUONConstants::TriggerTofLimit())
109 Bool_t isTrig[2]={kTRUE,kTRUE};
112 for ( Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath )
114 const AliMpVSegmentation* seg
115 = AliMpSegmentation::Instance()
116 ->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
118 AliMpPad pad = seg->PadByPosition(x,y,kFALSE);
119 Int_t ix = pad.GetIx();
120 Int_t iy = pad.GetIy();
122 AliDebug(1,Form("xhit,yhit=%e,%e lx,ly,lz=%e,%e,%e ix,iy=%d,%d",
123 xhit,yhit,x,y,z,ix,iy));
125 if ( !pad.IsValid() )
127 AliWarning(Form("hit w/o strip %d-%d xhit,yhit=%e,%e local x,y,z "
128 "%e,%e,%e ix,iy=%d,%d",detElemId,
130 xhit,yhit,x,y,z,ix,iy));
134 if(fTriggerEfficiency){
136 nboard = pad.GetLocalBoardId(0);
137 fTriggerEfficiency->IsTriggered(detElemId, nboard,
138 isTrig[0], isTrig[1]);
140 if(!isTrig[cath]) continue;
143 AliMUONDigit* d = new AliMUONDigit(detElemId,pad.GetLocalBoardId(0),
144 pad.GetLocalBoardChannel(0),cath);
147 //FIXME : a trigger digit can have several locations.
148 //this is not currently supported by the digit class. Change that or not ?
149 d->SetCharge(twentyNano);
155 if ( fTriggerEfficiency ) AliDebug(1,Form("MTReff: DetElemId %i Board %3i Fired %i %i", detElemId, nboard, isTrig[0], isTrig[1]));
159 //_____________________________________________________________________________
161 AliMUONResponseTrigger::InitTriggerEfficiency(AliMUONTriggerEfficiencyCells *triggerEfficiency)
163 /// Initialize trigger chamber efficiency (on demand)
165 if ( triggerEfficiency )
167 AliDebug(1, "Will apply trigger efficiency");
171 AliFatal("I was requested to apply trigger efficiency, but I could "
174 fTriggerEfficiency = new AliMUONTriggerChamberEfficiency(triggerEfficiency);