12 #include <tracking/modules/DATCON/SVDShaperDigitToDATCONSVDDigitConverterModule.h>
20 REG_MODULE(SVDShaperDigitToDATCONSVDDigitConverter)
29 setDescription(
"Converts SVDShaperDigits into DATCONSVDDigits and registers the relations needed.");
30 setPropertyFlags(c_ParallelProcessingCertified);
32 addParam(
"svdShaperDigitListName", m_storeSVDShaperDigitsListName,
"Name of the SVDShaperDigits list",
string(
""));
33 addParam(
"DATCONSVDDigitListName", m_storeDATCONSVDDigitsListName,
"Name of the m_storeDATCONSVDDigits list",
34 string(
"DATCONSVDDigits"));
35 addParam(
"svdTrueHitsListName", m_storeTrueHitsListName,
"Name of the SVDTrueHit list",
string(
""));
36 addParam(
"mcParticlesListName", m_storeMCParticlesListName,
"Name of the MCParticles list",
string(
""));
40 void SVDShaperDigitToDATCONSVDDigitConverterModule::initialize()
42 storeDATCONSVDDigits.registerInDataStore(m_storeDATCONSVDDigitsListName, DataStore::c_DontWriteOut);
43 m_storeDATCONSVDDigitsListName = storeDATCONSVDDigits.getName();
45 storeSVDShaperDigits.isRequired(m_storeSVDShaperDigitsListName);
46 m_storeSVDShaperDigitsListName = storeSVDShaperDigits.getName();
48 storeDATCONSVDDigits.registerRelationTo(storeSVDShaperDigits);
50 storeTrueHits.isOptional(m_storeTrueHitsListName);
51 if (storeTrueHits.isValid()) {
52 m_storeTrueHitsListName = storeTrueHits.getName();
53 storeDATCONSVDDigits.registerRelationTo(storeTrueHits, DataStore::c_Event, DataStore::c_DontWriteOut);
56 storeMCParticles.isOptional(m_storeMCParticlesListName);
57 if (storeMCParticles.isValid()) {
58 m_storeMCParticlesListName = storeMCParticles.getName();
59 storeDATCONSVDDigits.registerRelationTo(storeMCParticles, DataStore::c_Event, DataStore::c_DontWriteOut);
64 void SVDShaperDigitToDATCONSVDDigitConverterModule::event()
66 for (
auto& shaperdigit : storeSVDShaperDigits) {
70 VxdID sensorid = shaperdigit.getSensorID();
71 bool isu = shaperdigit.isUStrip();
72 short cellid = shaperdigit.getCellID();
75 DATCONSVDDigit newDATCONSVDDigit(sensorid, isu, cellid, rawsamples);
76 DATCONSVDDigit* datcondigit = storeDATCONSVDDigits.appendNew(newDATCONSVDDigit);
82 if (relatedMC.
size() > 0) {
83 for (
unsigned int relmcindex = 0; relmcindex < relatedMC.
size(); relmcindex++) {
87 if (relatedSVDTrue.size() > 0) {
88 for (
unsigned int reltruehitindex = 0; reltruehitindex < relatedSVDTrue.size(); reltruehitindex++) {
89 datcondigit->
addRelationTo(relatedSVDTrue[reltruehitindex], relatedSVDTrue.weight(reltruehitindex));