ATLAS Offline Software
Loading...
Searching...
No Matches
CscRawDataCollection.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONBYTESTREAM_CSCCRAWDATACOLLECTION_H
6#define MUONBYTESTREAM_CSCCRAWDATACOLLECTION_H
7
8
9
10#include "MuonRDO/CscRawData.h"
14#include <map>
15
23class CscRawDataCollection : public DataVector<CscRawData>
24{
25
26private:
27
29 uint32_t m_id;
30
33
35 uint16_t m_rodId;
37
39 uint16_t m_numRPU;
40
43
46
49
51 uint32_t m_eventType;
52
54 std::vector<uint16_t> m_rpuID;
55 std::vector<uint8_t> m_dataType;
56
61 std::vector<uint16_t> m_spuCount;
62
64 uint32_t m_scaAddress;
65
66public:
67
69 typedef uint16_t ID;
70 typedef CscRawData DIGIT;
71
74 : DataVector<CscRawData>(), m_id(id) {
75 m_numRPU = 0;
76 m_samplingPhase = false;
77 m_triggerType = false;
79 m_eventType = 0x0;
80 m_rpuID.clear();
81 m_dataType.clear();
82 m_spuCount.resize(10,0);
83 m_scaAddress = 0x0;
84 m_idHash = m_id;
85 m_rodId = 0;
87 }
88
90 : DataVector<CscRawData>(), m_id(0) {
91 m_numRPU = 0;
92 m_samplingPhase = false;
93 m_triggerType = false;
95 m_eventType = 0x0;
96 m_rpuID.clear();
97 m_dataType.clear();
98 m_spuCount.resize(10,0);
99 m_scaAddress = 0x0;
100 m_rodId = 0;
101 m_subDetectorId = 0;
102 }
103
105
107 uint16_t identify() const {return m_id;}
108
111
112 uint16_t rodId() const {return m_rodId;}
113 uint16_t subDetectorId() const {return m_subDetectorId;}
114 uint16_t numRPU() const { return m_rpuID.size(); }
115 const std::vector<uint16_t> & rpuID() const { return m_rpuID; }
116 const std::vector<uint8_t> & dataType() const { return m_dataType; }
117 bool samplingPhase() const {return m_samplingPhase; }
118 bool triggerType() const { return m_triggerType; }
119 uint8_t firstBitSummary() const { return m_firstBitSummary; }
120 uint32_t eventType () const { return m_eventType; }
121 uint8_t calAmplitude() const;
122 uint8_t calLayer() const;
123 uint32_t scaAddress() const { return m_scaAddress; }
124
125 uint16_t numSamples() const;
126 uint16_t latency() const;
127 uint8_t rate() const;
128
132 bool sparsified () const;
133 bool neutron () const;
134 bool calEnabled() const;
135
139 uint16_t spuCount(unsigned int i) const
140 {
141 if (i<10) return m_spuCount[i];
142 else return 0x0;
143 }
144
145 const std::vector<uint16_t>& spuCount() const { return m_spuCount; }
146
148 void setRodId (uint16_t rodId) {m_rodId = rodId;}
150 void setOnlineId (uint16_t id) {m_id = id; m_idHash = m_id; }
151
153 void setIdentifyHash(const IdentifierHash& idHash) { m_idHash=idHash;}
155 void set_samplingPhase(bool flag) { m_samplingPhase = flag; }
157 void set_triggerType(bool flag) { m_triggerType = flag; }
158 void set_firstBitSummary(const uint8_t summary) { m_firstBitSummary=summary; }
159 void set_eventType (const uint32_t eventType ) { m_eventType = eventType; }
160
161 void set_scaAddress( const uint32_t sca ) { m_scaAddress = sca; }
162 void set_spuCount ( unsigned int i, uint16_t count)
163 { if ( i<10 ) m_spuCount[i]=count; }
164 void set_spuCount ( const std::vector<uint16_t>& spuCount)
165 { m_spuCount = spuCount; }
166
167 void setSamplingRate (const uint16_t rate);
168 void setNumSamples (const uint16_t n);
169 void setLatency (const uint16_t latency);
170 void setNumDPU (const uint16_t numDPU);
171
173 void set_sparsified ();
174
176 void set_neutron ();
177
179 void set_enableCal ();
180
182 void set_calAmplitude ( const uint8_t calAmp );
183
185 void set_calLayer ( const uint8_t calLay );
186
187 void setRPUID (const std::vector<uint16_t>& rpuID) { m_rpuID = rpuID; }
188 void addRPU (const uint16_t rpuID ) { m_rpuID.push_back(rpuID); }
189 void addDataType (const uint8_t dataType ) { m_dataType.push_back(dataType); }
190 void set_dataType( const unsigned int i, const uint8_t dataType) {
191 if ( i < m_dataType.size() ) m_dataType[i] = dataType;
192 }
193 void set_dataType( const std::vector<uint8_t>& dataType)
194 { m_dataType = dataType; }
195};
196
198
199/* Class_Def needed only for persistency */
202
204std::ostream& operator << ( std::ostream& sl, const CscRawDataCollection& coll);
205
206#endif
207
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
DataVector< CscRawDataCollection > CSC_RAWDATACOLLECTION_vector
An STL vector of pointers that by default owns its pointed-to elements.
Collection of CSC Raw Hits, arranged according to CSC Detector Elements Author: Ketevi A.
void set_scaAddress(const uint32_t sca)
uint32_t m_id
Identifier of this collection.
void set_dataType(const std::vector< uint8_t > &dataType)
bool sparsified() const
is sparsified data?
void set_spuCount(const std::vector< uint16_t > &spuCount)
void set_eventType(const uint32_t eventType)
uint32_t m_eventType
event type/data type
IdentifierHash identifyHash() const
Returns the OFFLINE identifier hash for this collection.
void setRodId(uint16_t rodId)
set methods - the name should be self-descriptive
std::vector< uint16_t > m_spuCount
cluster counts for 10 SPU: 5 SPU in each chamber or RPU!
const std::vector< uint16_t > & spuCount() const
uint16_t m_numRPU
number of RPU
void set_enableCal()
is calibration enabled
void set_sparsified()
is this sparsified data?
void setLatency(const uint16_t latency)
insert the latency into the detector event type word
void setNumSamples(const uint16_t n)
insert the number of samples into the detector event type word
void set_triggerType(bool flag)
uint8_t calAmplitude() const
Calibration pulser amplitude.
void addDataType(const uint8_t dataType)
std::vector< uint8_t > m_dataType
void set_spuCount(unsigned int i, uint16_t count)
void set_calAmplitude(const uint8_t calAmp)
set the calibration amplitude
uint8_t firstBitSummary() const
IdentifierHash m_idHash
Offline IdentifierHash for this collection.
uint16_t identify() const
access methods
CscRawDataCollection(uint32_t id)
Default constructor.
void addRPU(const uint16_t rpuID)
bool calEnabled() const
is calibration enabled?
void setIdentifyHash(const IdentifierHash &idHash)
sets the OFFLINE IdentifierHash for this collection
uint16_t spuCount(unsigned int i) const
return the SPU cluster counts For all the non-precision layers,
std::vector< uint16_t > m_rpuID
RPU ID and data type.
void set_neutron()
is neutron rejection applied?
void setRPUID(const std::vector< uint16_t > &rpuID)
uint16_t subDetectorId() const
uint8_t m_firstBitSummary
First Bit Summary.
bool neutron() const
is neutron rejection ON?
void set_samplingPhase(bool flag)
const std::vector< uint16_t > & rpuID() const
void setNumDPU(const uint16_t numDPU)
obsolete - just backward compatibility with old data
bool m_triggerType
trigger Type
bool m_samplingPhase
sampling phase
uint8_t calLayer() const
Calibration layer.
uint16_t ID
typedef required by container
void setSamplingRate(const uint16_t rate)
insert the rate into the detector event type word - the rate can 20 or 40 MHz
void set_dataType(const unsigned int i, const uint8_t dataType)
uint16_t m_rodId
online ROD Identifier
const std::vector< uint8_t > & dataType() const
void set_calLayer(const uint8_t calLay)
set the layer number where the calibration is been done
void set_firstBitSummary(const uint8_t summary)
void setOnlineId(uint16_t id)
void setSubDetectorId(uint16_t subDetectorId)
uint32_t m_scaAddress
SCA Address.
uint8_t rate() const
the rate could be 25 or 50 ns
Class to hold the electronic output for a single CSC readout channel: n sampling ADC data + the addre...
Definition CscRawData.h:21
Derived DataVector<T>.
Definition DataVector.h:795
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
This is a "hash" representation of an Identifier.
STL class.
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
STL namespace.