 |
Belle II Software
release-05-02-19
|
11 #ifndef FADC_APV_MAPPER_H_
12 #define FADC_APV_MAPPER_H_
14 #include <vxd/dataobjects/VxdID.h>
15 #include <svd/dataobjects/SVDModeByte.h>
16 #include <svd/dataobjects/SVDShaperDigit.h>
17 #include <boost/property_tree/ptree.hpp>
18 #include <unordered_map>
19 #include <unordered_set>
39 class SVDOnlineToOfflineMap {
58 {
m_id.parts.FADC = FADC;
m_id.parts.APV25 = APV25; }
113 {
m_ID.PARTS.layer = layer;
m_ID.PARTS.ladder = ladder;
m_ID.PARTS.dssd = dssd;
m_ID.PARTS.side = side; }
176 unsigned char channel,
short samples[6],
float time = 0.0,
195 bool isAPVinMap(
unsigned short layer,
unsigned short ladder,
unsigned short dssd,
bool side,
unsigned short strip);
235 const ChipInfo&
getChipInfo(
unsigned short layer,
unsigned short ladder,
unsigned short dssd,
bool side,
unsigned short strip);
243 {
return (info.m_channel0 + ((
unsigned short)channel) * (info.m_parallel ? 1 : -1)); }
253 typedef std::unordered_map<unsigned short, unsigned short>
FADCmap;
268 void ReadLayer(
int nLayer, boost::property_tree::ptree
const& xml_layer);
272 void ReadLadder(
int nLayer,
int nLadder, boost::property_tree::ptree
const& xml_ladder);
276 void ReadSensor(
int nLayer,
int nLadder,
int nSensor, boost::property_tree::ptree
const& xml_sensor);
281 void ReadSensorSide(
int nLayer,
int nLadder,
int nSensor,
bool isU, boost::property_tree::ptree
const& xml_side);
289 std::unordered_map< ChipID::baseType, SensorInfo >
m_sensors;
290 std::unordered_map< SensorID::baseType, std::vector<ChipInfo> >
m_chips;
300 void addChip(
unsigned char chipN,
302 int nlayer,
int nladder,
int nsensor,
bool isU,
303 unsigned short stripNumberCh0,
308 void addChip(
unsigned char chipN,
310 unsigned short stripNumberCh0,
std::unordered_map< ChipID::baseType, SensorInfo > m_sensors
m_sensors[ChipID(FADC,APV25)] gives the SensorInfo for the given APV25 on the given FADC (Unpacker)
SensorID & operator=(baseType id)
check if VxdID is the same or not
std::unordered_multimap< unsigned char, unsigned char > APVforFADCmap
map containing FADC numbers assigned to multiple APVs, from xml file
chipNumberType getAPV25() const
Get APV25 number.
std::unordered_set< unsigned char > FADCnumbers
container for FADC numbers from current mapping file
Class to uniquely identify a any structure of the PXD and SVD.
int getNumberOfMissingAPVs()
Get number of missing APVs.
void ReadLayer(int nLayer, boost::property_tree::ptree const &xml_layer)
Read from the ptree v in the xml file the layer nLayer.
unsigned short baseType
Typedefs of the compound id type and chip number types.
void setAPV25(chipNumberType APV25)
Set APV25 number.
ChipID & operator=(ChipID other)
Assignment from same type.
void ReadSensor(int nLayer, int nLadder, int nSensor, boost::property_tree::ptree const &xml_sensor)
Read from the ptree xml_sensor the sensor nSensor in ladder nLadder in layer nLayer.
unsigned short m_channel127
Strip corresponding to channel 127.
Struct to hold data about an APV25 chip.
bool operator==(const ChipID &other) const
equality
void prepareListOfMissingAPVs()
prepares the list of the missing APVs using the channel mapping
VxdID m_sensorID
Sensor ID.
Class to store SVD mode information.
VxdID m_sensorID
Sensor ID.
ChipID(baseType id=0)
Constructor taking a compound id.
bool m_isUSide
True if u-side of the sensor.
short getStripNumber(unsigned char channel, const SensorInfo &info) const
Convert APV channel number to a strip number using a ChipInfo object.
unsigned short sensorNumberType
Type of chip numbers.
void ReadLadder(int nLayer, int nLadder, boost::property_tree::ptree const &xml_ladder)
Read from the ptree xml_ladde the ladder nLadder in layer nLayer.
unsigned short m_channel0
Strip corresponding to channel 0.
float m_halfStrip
floating strip in the middle of the APV
The SVD ShaperDigit class.
unsigned short baseType
Typedefs of the compound id type and chip number types.
bool m_parallel
False if numbering is reversed.
SensorID(baseType id=0)
Constructor taking a compound id.
unsigned short stripFirst
first strip number
void setErrorRate(int errorRate)
Setter for suppression factor given by the Unpacker.
Specific implementation of SensorInfo for PXD Sensors which provides additional pixel specific inform...
struct to hold missing APVs informations
int m_errorRate
The suppression factor of BadMapping ERRORs messages to be shown.
bool isAPVinMap(unsigned short layer, unsigned short ladder, unsigned short dssd, bool side, unsigned short strip)
is the APV of the strips in the map? for a given layer/ladder/dssd/side/strip combination.
Struct to hold data about a sensor.
Abstract base class for different kinds of events.
void addChip(unsigned char chipN, unsigned char FADCn, int nlayer, int nladder, int nsensor, bool isU, unsigned short stripNumberCh0, bool isParallel)
add chipN on FADCn to the map
unsigned short stripLast
last strip number
SensorInfo m_currentSensorInfo
current sensor info
unsigned short fadc
fadc number
const ChipInfo & getChipInfo(unsigned short layer, unsigned short ladder, unsigned short dssd, bool side, unsigned short strip)
Get ChipInfo for a given layer/ladder/dssd/side/strip combination.
Class to hold FADC+APV25 numbers.
struct Belle2::SVDOnlineToOfflineMap::ChipID::@243::@244 parts
Alternative struct representation.
void ReadSensorSide(int nLayer, int nLadder, int nSensor, bool isU, boost::property_tree::ptree const &xml_side)
Read from the ptree xml_side the U-side, if isU, (the V-side otherwise) of the sensor nSensor in ladd...
chipNumberType getFADC() const
Get FADC number.
std::unordered_map< unsigned short, unsigned short > FADCmap
FADC map typedef.
SVDShaperDigit * NewShaperDigit(unsigned char FADC, unsigned char APV25, unsigned char channel, short samples[6], float time=0.0, SVDModeByte mode=SVDModeByte())
Return a pointer to a new SVDShpaerDigit whose VxdID, isU and cellID is set.
SVDOnlineToOfflineMap()=delete
No default constructor.
unsigned char chipNumberType
Type of chip numbers.
unsigned char apvChannel
apv channel
std::vector< missingAPV > m_missingAPVs
list of the missing APVs
unsigned char apv
apv number
union Belle2::SVDOnlineToOfflineMap::ChipID::@243 m_id
Union type representing the ChipID compound.
void setFADC(chipNumberType FADC)
Set FADC number.
std::unordered_map< SensorID::baseType, std::vector< ChipInfo > > m_chips
needed for the packer, map of VxdID to chips
union Belle2::SVDOnlineToOfflineMap::SensorID::@245 m_ID
Union type representing the SensorID compound.
std::string m_MapUniqueName
Human readable unique name of this map.
unsigned short getFADCboardsNumber()
get the num,ner of FADC boards
void setID(baseType id)
Set chip ID.
const SensorInfo & getSensorInfo(unsigned char FADC, unsigned char APV25)
Get SensorInfo for a given FADC/APV combination.
unsigned int nBadMappingErrors
Counter of the BadMapping errors.
struct Belle2::SVDOnlineToOfflineMap::SensorID::@245::@246 PARTS
Alternative struct representation.
bool operator<(const ChipID &other) const
ordering
bool m_uSide
True if u-side of the sensor.
baseType getID() const
Get chip ID.
ChipInfo m_currentChipInfo
internal instance of chipinfo used by the getter
void prepFADCmaps(FADCmap &, FADCmap &)
function that maps FADC numbers as 0-(nFADCboards-1) from FADCnumbers unordered_set
Class to hold numbers related to sensor.