![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "GaudiKernel/MsgStream.h"
14 #include "CLHEP/Units/SystemOfUnits.h"
15 #include "CLHEP/Units/PhysicalConstants.h"
21 #include "CaloDetDescr/CaloDetDescrElement.h"
25 using CLHEP::Hep3Vector;
30 #define MAXINT 2147483000
31 #define MAXINT2 -2147483000
35 const std::string&
name,
36 const IInterface*
parent) :
38 m_peakReco(
"LArOFPeakRecoTool"),
65 if(
sc.isFailure() ) {
66 log << MSG::ERROR <<
"Unable to retrieve LArOFPeakRecoTool" <<
endmsg;
67 return StatusCode::FAILURE;
75 return StatusCode::SUCCESS;
81 const std::vector<float>& ramps,
93 (*pLog) <<
MSG::DEBUG <<
"Saturation on channel 0x"
94 << MSG::hex << chid.
get_compact() << MSG::dec <<
". ";
98 (*pLog) <<
"Skipping channel." <<
endmsg;
106 const std::vector < short >&
samples =
digit->samples();
107 unsigned int sampsize = (
unsigned int)
samples.size();
109 unsigned int ipeak = 0;
110 std::vector<float>
signal ;
112 for (
unsigned int ii = 0; ii < sampsize; ii++) {
114 signal.push_back(currval);
120 double globaltimeoffset = -25;
126 if (
sc.isFailure()) {
128 (*pLog) << MSG::ERROR
129 <<
"Unable to retrieve ComTime from StoreGate" <<
endmsg;
130 return static_cast<bool>(
sc);
140 double tileComTime = comTime->
getTime();
144 if(tileComTime!=0 || muonpos.x()!=0 || muonpos.z()!=0) {
148 globaltimeoffset = 0.;
150 if (caloDDE !=
nullptr) {
152 double xpos=caloDDE->
x();
153 double ypos=caloDDE->
y();
154 double zpos=caloDDE->
z();
156 const double inv_c_light = 1. /
c_light;
157 timeTOF = (sqrt((muonpos.x()-xpos)*(muonpos.x()-xpos) + (muonpos.y()-ypos)*(muonpos.y()-ypos) + (muonpos.z()-zpos)*(muonpos.z()-zpos))) * inv_c_light;
158 IPTOF = (sqrt(xpos*xpos+ypos*ypos+zpos*zpos)) * inv_c_light;
168 if ((ypos>0 && muondir.y()<0) || (ypos<0 && muondir.y()>0)) timeTOF=timeTOF*(-1);
172 double larTimeOffset = tileComTime + timeTOF + IPTOF + globaltimeoffset;
179 double peakSampleTile =
int( (larTimeOffset*(1./25.)) + 2.);
180 m_delayTile = 25.*(peakSampleTile-2) - larTimeOffset;
197 if (ipeak < 2) ipeak = 2;
198 if (ipeak > sampsize - 3) ipeak = sampsize - 3 ;
202 unsigned int peak_min = ipeak - 1 ;
203 if (peak_min < 2) peak_min = 2;
205 unsigned int peak_max = ipeak + 1 ;
206 if (peak_max > sampsize - 3) peak_max = sampsize - 3 ;
213 ADCPeak =
results.getAmplitude();
219 (*pLog) <<
MSG::DEBUG <<
". OFC not valid for channel 0x"
221 <<
" Gain = " <<
gain <<
". Skipping channel." <<
endmsg;
228 for(
unsigned int i=0;
i<ramps.size();
i++)
240 iquality = ((
int)(
results.getQuality())) & 0xFFFF;
241 iprovenance = iprovenance | 0x2000;
246 iprovenance = iprovenance & 0x3FFF;
250 const float fMAXINT =
static_cast<float>(
MAXINT);
251 const float fMAXINT2 =
static_cast<float>(
MAXINT2);
263 iquality,iprovenance,
digit->gain());
CaloGain::CaloGain curr_gain
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
void setErrorString(unsigned int nerr, const std::string &s)
Returns various counters from the LArRawChannel building.
void incrementErrorCount(unsigned int nerr)
Definition of CaloDetDescrManager.
int curr_shiftTimeSamples
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
CLHEP::Hep3Vector GetcosThetaDirection() const
msgSvc
Provide convenience handles for various services.
Liquid Argon digit base class.
void add(const LArRawChannel &rc)
Liquid Argon ROD output object base class.
::StatusCode StatusCode
StatusCode definition for legacy code.
double delay(std::size_t d)
StatusCode initialize(bool used=true)
value_type get_compact(void) const
Get the compact id.
This class provides the client interface for accessing the detector description information common to...
CLHEP::Hep3Vector GetCounterPosition() const
unsigned int returnBitPattern() const
unsigned int qualityBitPattern