ATLAS Offline Software
CscStripPrepData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // CscStripPrepData.cxx
7 // Implementation file for class CscStripPrepData
9 // (c) ATLAS Detector software
11 // Version 1.0 03/29/2005 Ketevi A. Assamagan
13 
14 #include <new>
15 #include <sstream>
17 #include "GaudiKernel/MsgStream.h"
18 
19 namespace Muon
20 {
21 
22 
24  const IdentifierHash& collectionHash,
25  const Amg::Vector2D& locpos,
26  const Amg::MatrixX& locErrMat,
27  const MuonGM::CscReadoutElement* detEl,
28  const std::vector<float>& sampleCharges,
29  float timeOfFirstSample,
30  unsigned short samplingTime
31  ):
32  PrepRawData(RDOId, locpos, locErrMat), //call base class constructor
33  m_collectionHash(collectionHash),
34  m_globalPosition(),
35  m_detEl(detEl),
36  m_sampleCharges(sampleCharges),
37  m_timeOfFirstSample(timeOfFirstSample),
38  m_samplingTime(samplingTime),
39  m_samplingPhase(false)
40  {
41  }
42 
44  const IdentifierHash& collectionHash,
45  const Amg::Vector2D& locpos,
46  Amg::MatrixX&& locErrMat,
47  const MuonGM::CscReadoutElement* detEl,
48  const std::vector<float>& sampleCharges,
49  float timeOfFirstSample,
50  unsigned short samplingTime
51  ):
52  PrepRawData(RDOId, locpos, std::move(locErrMat)), //call base class constructor
53  m_collectionHash(collectionHash),
54  m_globalPosition(),
55  m_detEl(detEl),
56  m_sampleCharges(sampleCharges),
57  m_timeOfFirstSample(timeOfFirstSample),
58  m_samplingTime(samplingTime),
59  m_samplingPhase(false)
60  {
61  }
62 
63 
64  // Destructor:
66  = default;
67 
68  // Default constructor:
70  PrepRawData(),
71  m_collectionHash(),
72  m_globalPosition(),
73  m_detEl(nullptr),
74  m_sampleCharges(),
75  m_timeOfFirstSample(0),
76  m_samplingTime(0),
77  m_samplingPhase(false)
78  { }
79 
80  //copy constructor:
82  PrepRawData(RIO),
83  m_collectionHash( RIO.m_collectionHash ),
84  m_globalPosition(),
85  m_detEl( RIO.m_detEl ),
86  m_sampleCharges( RIO.m_sampleCharges ),
87  m_timeOfFirstSample ( RIO.m_timeOfFirstSample ),
88  m_samplingTime( RIO.m_samplingTime ),
89  m_samplingPhase( RIO.m_samplingPhase )
90  { }
91 
92  //assignment operator
94  {
95  if (&RIO !=this)
96  {
97  if (m_globalPosition) m_globalPosition.release().reset();
99  m_detEl = RIO.m_detEl ;
104  PrepRawData::operator=(RIO);
105  }
106  return *this;
107  }
108 
109  MsgStream& CscStripPrepData::dump( MsgStream& stream) const
110  {
111  stream << MSG::INFO << "CscStripPrepData {" <<endmsg;
112 
113  std::stringstream s;
114  s << std::setiosflags(std::ios::fixed);
115  s << std::setprecision(4);
116  s << "Samples = ";
117  for( unsigned int i=0;i<m_sampleCharges.size();++i) s << m_sampleCharges[i] << " , ";
118  s << std::endl;
119  s << "Time of first sample= "<<this->timeOfFirstSample() << ", sampling Time (ns) "
120  << this->samplingTime() << ", sampling Phase " << this->samplingPhase();
121  s << "} End CscStripPrepData" << std::endl;
122  stream << s.str();
123 
124  return stream;
125  }
126 
127  std::ostream& CscStripPrepData::dump( std::ostream& stream) const
128  {
129  stream << "CscStripPrepData {"<<std::endl;
130 
131  std::stringstream s;
132  s << std::setiosflags(std::ios::fixed);
133  s << std::setprecision(4);
134 
135  s << "Samples = ";
136  for( unsigned int i=0;i<m_sampleCharges.size();++i) s << m_sampleCharges[i] << " , ";
137  s << std::endl;
138  s << "Time of first sample= "<<this->timeOfFirstSample() << ", sampling time(ns) "
139  << this->samplingTime();
140  s << "} End CscStripPrepData" << std::endl;
141  stream << s.str();
142 
143  return stream;
144  }
145  //end of classdef
146 
147 }//end of ns
Muon::CscStripPrepData::samplingTime
unsigned short samplingTime() const
return the sampling time in ns: the time between samplings
Definition: CscStripPrepData.h:173
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
CscStripPrepData.h
Muon::CscStripPrepData::operator=
CscStripPrepData & operator=(const CscStripPrepData &)
Definition: CscStripPrepData.cxx:93
MuonGM::CscReadoutElement
Definition: CscReadoutElement.h:56
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
Muon::CscStripPrepData::dump
virtual MsgStream & dump(MsgStream &stream) const override final
dump information about the PRD
Definition: CscStripPrepData.cxx:109
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
Muon::CscStripPrepData::m_collectionHash
IdentifierHash m_collectionHash
The IdenifierHash of the collection used to store this PRD.
Definition: CscStripPrepData.h:126
Muon::CscStripPrepData::m_timeOfFirstSample
float m_timeOfFirstSample
Definition: CscStripPrepData.h:131
Muon::CscStripPrepData
Class representing the raw data of one CSC strip (for clusters look at Muon::CscPrepData).
Definition: CscStripPrepData.h:40
lumiFormat.i
int i
Definition: lumiFormat.py:92
Muon::CscStripPrepData::samplingPhase
bool samplingPhase() const
return the sampling phase
Definition: CscStripPrepData.h:178
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Muon::CscStripPrepData::m_globalPosition
CxxUtils::CachedUniquePtr< const Amg::Vector3D > m_globalPosition
The global position is calculated 'on the fly' and is not written to disk.
Definition: CscStripPrepData.h:128
Muon::CscStripPrepData::CscStripPrepData
CscStripPrepData()
Definition: CscStripPrepData.cxx:69
Muon::CscStripPrepData::m_sampleCharges
std::vector< float > m_sampleCharges
Definition: CscStripPrepData.h:130
Muon::CscStripPrepData::m_samplingPhase
bool m_samplingPhase
Definition: CscStripPrepData.h:133
IdentifierHash
Definition: IdentifierHash.h:38
Muon::CscStripPrepData::m_samplingTime
unsigned short m_samplingTime
Definition: CscStripPrepData.h:132
Muon::CscStripPrepData::~CscStripPrepData
virtual ~CscStripPrepData()
Destructor:
Muon::CscStripPrepData::m_detEl
const MuonGM::CscReadoutElement * m_detEl
Definition: CscStripPrepData.h:129
Muon::CscStripPrepData::timeOfFirstSample
double timeOfFirstSample() const
return the time of the first sample
Definition: CscStripPrepData.h:168