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"
35 #include "AliMpCathodType.h"
36 #include "AliMpPlaneType.h"
37 #include "AliMpSegmentation.h"
38 #include "AliMpVSegmentation.h"
45 ClassImp(AliMUONResponseTrigger)
52 return static_cast<AliMUON*>(gAlice->GetModule("MUON"));
55 void Global2Local(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg,
56 Double_t& xl, Double_t& yl, Double_t& zl)
58 // ideally should be :
60 // AliMUONGeometry::Global2Local(detElemId,xg,yg,zg,x,y,z);
61 // but while waiting for this geometry singleton, let's go through
64 const AliMUONGeometryTransformer* transformer = muon()->GetGeometryTransformer();
65 transformer->Global2Local(detElemId,xg,yg,zg,xl,yl,zl);
69 //------------------------------------------------------------------
70 AliMUONResponseTrigger::AliMUONResponseTrigger()
73 /// Default constructor
76 //------------------------------------------------------------------
77 AliMUONResponseTrigger::~AliMUONResponseTrigger()
82 //_____________________________________________________________________________
84 AliMUONResponseTrigger::DisIntegrate(const AliMUONHit& hit, TList& digits, Float_t /*timeDif*/)
86 /// Generate 2 digits (one on each cathode) from 1 hit, i.e. no cluster-size
87 /// generation (simplest response case).
91 Float_t xhit = hit.X();
92 Float_t yhit = hit.Y();
93 Float_t zhit = hit.Z();
94 Int_t detElemId = hit.DetElemId();
97 Global2Local(detElemId,xhit,yhit,zhit,x,y,z);
99 Float_t tof = hit.Age();
100 Int_t twentyNano(100);
101 if (tof<AliMUONConstants::TriggerTofLimit())
108 for ( Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath )
110 const AliMpVSegmentation* seg
111 = AliMpSegmentation::Instance()
112 ->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
114 AliMpPad pad = seg->PadByPosition(x,y,kFALSE);
115 Int_t ix = pad.GetIx();
116 Int_t iy = pad.GetIy();
118 AliDebug(1,Form("xhit,yhit=%e,%e lx,ly,lz=%e,%e,%e ix,iy=%d,%d",
119 xhit,yhit,x,y,z,ix,iy));
121 if ( !pad.IsValid() )
123 AliWarning(Form("hit w/o strip %d-%d xhit,yhit=%e,%e local x,y,z "
124 "%e,%e,%e ix,iy=%d,%d",detElemId,
126 xhit,yhit,x,y,z,ix,iy));
130 if ( cath == AliMp::kCath0 ) nboard = pad.GetLocalBoardId(0);
132 AliMUONDigit* d = new AliMUONDigit(detElemId,nboard,
133 pad.GetLocalBoardChannel(0),cath);
136 //FIXME : a trigger digit can have several locations.
137 //this is not currently supported by the digit class. Change that or not ?
138 d->SetCharge(twentyNano);