diff --git a/k4GaudiPandora/CMakeLists.txt b/k4GaudiPandora/CMakeLists.txt index f43fec8..067e009 100644 --- a/k4GaudiPandora/CMakeLists.txt +++ b/k4GaudiPandora/CMakeLists.txt @@ -1,5 +1,5 @@ #[[ -Copyright (c) 2020-2023 Key4hep-Project. +Copyright (c) 2020-2024 Key4hep-Project. This file is part of Key4hep. See https://key4hep.github.io/key4hep-doc/ for further info. diff --git a/k4GaudiPandora/include/CalorimeterHitType.h b/k4GaudiPandora/include/CalorimeterHitType.h index 33fd7ba..9b96d81 100644 --- a/k4GaudiPandora/include/CalorimeterHitType.h +++ b/k4GaudiPandora/include/CalorimeterHitType.h @@ -1,4 +1,22 @@ -#ifndef CalorimeterHitType_h +/* + * Copyright (c) 2020-2024 Key4hep-Project. + * + * This file is part of Key4hep. + * See https://key4hep.github.io/key4hep-doc/ for further info. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef CalorimeterHitType_h #define CalorimeterHitType_h 1 #include @@ -9,28 +27,28 @@ * Example usage:
*
  *     lcio::CalorimeterHit* cHit = .... ;
- * 
- *     // set the type (e.g. in digitization ) 
+ *
+ *     // set the type (e.g. in digitization )
  *     cHit->setType( CHT( CHT::em ,  CHT::ecal , CHT::plug , 12 ) ) ;
  *
  *     ...
  *
  *     CHT cht = cHit->getType() ;
- * 
+ *
  *     //   sum energies for electromagentic, hadronic and tailcatcher:
- *     if( cht.is( CHT::em ) ) 
+ *     if( cht.is( CHT::em ) )
  *          e_em +=  cHit->getEnergy() ;
- *     else 
- *       if ( cht.is(CHT::had ) ) 
+ *     else
+ *       if ( cht.is(CHT::had ) )
  *          e_had += cHit->getEnergy() ;
  *       else
  *          e_muon += cHit->getEnergy() ;
- * 
+ *
  *     // use only EcalPlug hits:
- *     if( cht.is( CHT::ecal) && cht.is( CHT::plug) ) 
- *      
- *     // get the layer number (e.g. for calibration or clustering) 
- *     unsigned l = cht.layer() ; 
+ *     if( cht.is( CHT::ecal) && cht.is( CHT::plug) )
+ *
+ *     // get the layer number (e.g. for calibration or clustering)
+ *     unsigned l = cht.layer() ;
  *     // or directly :
  *     unsigned l = CHT(  cHit->getType() ).layer()  ;
  *
@@ -38,153 +56,107 @@
  *     std::cout <<  CHT(  cHit->getType() ) << std::endl ;
  *
  *  
- * + * * F.Gaede, DESY, 12/2008 */ -class CHT{ - +class CHT { public: - /** calorimeter types */ - typedef enum { - em = 0 , - had = 1, - muon = 2 - } CaloType ; - + typedef enum { em = 0, had = 1, muon = 2 } CaloType; + /** calo ids - specific to ILD */ - typedef enum { - unknown = 0 , - ecal = 1 , - hcal = 2 , - yoke = 3 , - lcal = 4 , - lhcal = 5 , - bcal = 6 - } CaloID ; - - /** calo layout / subdetector */ - typedef enum { - any = 0 , - barrel = 1 , - endcap = 2 , - plug = 3 , - ring = 4 - } Layout ; - - + typedef enum { unknown = 0, ecal = 1, hcal = 2, yoke = 3, lcal = 4, lhcal = 5, bcal = 6 } CaloID; + + /** calo layout / subdetector */ + typedef enum { any = 0, barrel = 1, endcap = 2, plug = 3, ring = 4 } Layout; + /** C'tor for initialization from CalorimeterHit::getType() */ - CHT(int type) :_type(type) { - } - + CHT(int type) : _type(type) {} + /** C'tor for encoding the calo type inforamtion */ - CHT(CaloType c, CaloID n, Layout l , unsigned lay): - _type(c * fCaloType + n * fCaloID + l * fLayout + lay * fLayer) - {} - + CHT(CaloType c, CaloID n, Layout l, unsigned lay) : _type(c * fCaloType + n * fCaloID + l * fLayout + lay * fLayer) {} + /** calorimeter type: CHT::em , CHT::had, CHT::muon */ - CaloType caloType() const { - return (CaloType) (_type % fCaloID ) ; - } + CaloType caloType() const { return (CaloType)(_type % fCaloID); } /** calo ID - see enum CaloID for allowed values */ - CaloID caloID() const { - return (CaloID) ( (_type % fLayout ) / fCaloID ) ; - } - + CaloID caloID() const { return (CaloID)((_type % fLayout) / fCaloID); } + /** calo layout - see enum layout for allowed values */ - Layout layout() const { - return (Layout) ( (_type % fLayer ) / fLayout ) ; - } - + Layout layout() const { return (Layout)((_type % fLayer) / fLayout); } + /** calo layer of hit */ - unsigned layer() const { - return unsigned ( _type ) / fLayer ; - } - - bool is(CaloType t) const { - return caloType() == t ; - } - - bool is(CaloID n) const { - return caloID() == n ; - } - - bool is(Layout l) const { - return layout() == l ; - } - + unsigned layer() const { return unsigned(_type) / fLayer; } + + bool is(CaloType t) const { return caloType() == t; } + + bool is(CaloID n) const { return caloID() == n; } + + bool is(Layout l) const { return layout() == l; } + /** automatic conversion to int */ - operator int() const { return _type ;} + operator int() const { return _type; } /** explicit conversion to int */ - int toInt() const { return _type ;} - + int toInt() const { return _type; } + protected: - - int _type ; - - static const int fCaloType = 1 ; - static const int fCaloID = 10 ; - static const int fLayout = 1000 ; - static const int fLayer = 10000 ; - -} ; + int _type; -/** detailed string for calo type */ -std::ostream& operator<<(std::ostream& os, const CHT& cht) ; + static const int fCaloType = 1; + static const int fCaloID = 10; + static const int fLayout = 1000; + static const int fLayer = 10000; +}; +/** detailed string for calo type */ +std::ostream& operator<<(std::ostream& os, const CHT& cht); /** Return Layout based on the collection name, e.g. if name contains tolower("endcap") CHT::endcap is returned. In case no known layout is found, CHT::any is returned.*/ -CHT::Layout layoutFromString(const std::string& name) ; +CHT::Layout layoutFromString(const std::string& name); /** Return caloID based on the collection name, e.g. if name contains tolower("HCal") CHT::hcal is returned. In case no known type is found, CHT::unknown is returned.*/ -CHT::CaloID caloIDFromString(const std::string& name) ; +CHT::CaloID caloIDFromString(const std::string& name); /** Return caloType from string, e.g. if name contains tolower("Had") CHT::had is returned. In case no known type is found, CHT::em is returned.*/ -CHT::CaloType caloTypeFromString(const std::string& name) ; - - +CHT::CaloType caloTypeFromString(const std::string& name); #endif - // int main(){ - + // CHT ct( CHT::em , CHT::ecal , CHT::plug , 12 ) ; // std::cout << ct << std::endl ; // std::cout << " caloType : " << ct.toInt() << std::endl ; - -// std::cout << " caloID " << ct.caloID() -// << " is bcal " << ct.is( CHT::bcal ) -// << " is muon " << ct.is( CHT::muon ) -// << " layer " << ct.layer() + +// std::cout << " caloID " << ct.caloID() +// << " is bcal " << ct.is( CHT::bcal ) +// << " is muon " << ct.is( CHT::muon ) +// << " layer " << ct.layer() // << std::endl ; - + // int i = CHT( CHT::muon , CHT::ecal , CHT::endcap , 123 ) ; - + // std::cout << " type i : " << i << std::endl ; - // std::cout << " layer from int : " << CHT(i).layer() << std::endl ; // CHT it(i) ; -// std::cout << " caloID " << it.caloID() -// << " is bcal " << it.is( CHT::bcal ) -// << " is muon " << it.is( CHT::muon ) -// << " is endcap " << it.is( CHT::endcap ) -// << " layer " << it.layer() -// << " layout " << it.layout() +// std::cout << " caloID " << it.caloID() +// << " is bcal " << it.is( CHT::bcal ) +// << " is muon " << it.is( CHT::muon ) +// << " is endcap " << it.is( CHT::endcap ) +// << " layer " << it.layer() +// << " layout " << it.layout() // << std::endl ; - // std::cout << it << std::endl ; // CHT ct2 = 12345678 ; diff --git a/k4GaudiPandora/include/DDSimpleMuonDigi.h b/k4GaudiPandora/include/DDSimpleMuonDigi.h index cd251bc..3b45c51 100644 --- a/k4GaudiPandora/include/DDSimpleMuonDigi.h +++ b/k4GaudiPandora/include/DDSimpleMuonDigi.h @@ -1,70 +1,90 @@ +/* + * Copyright (c) 2020-2024 Key4hep-Project. + * + * This file is part of Key4hep. + * See https://key4hep.github.io/key4hep-doc/ for further info. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #ifndef DDSimpleMuonDigi_H #define DDSimpleMuonDigi_H #include "Gaudi/Property.h" #include "GaudiAlg/Transformer.h" -#include "edm4hep/SimCalorimeterHitCollection.h" +#include "edm4hep/CaloHitContributionCollection.h" #include "edm4hep/CalorimeterHitCollection.h" #include "edm4hep/EventHeaderCollection.h" #include "edm4hep/MCRecoCaloAssociationCollection.h" -#include "edm4hep/CaloHitContributionCollection.h" +#include "edm4hep/SimCalorimeterHitCollection.h" #include "CalorimeterHitType.h" +#include "DDRec/SurfaceManager.h" +#include "k4FWCore/Transformer.h" #include "k4Interface/IGeoSvc.h" #include "k4Interface/IUniqueIDGenSvc.h" -#include "k4FWCore/Transformer.h" -#include "DDRec/SurfaceManager.h" #include #include #include struct DDSimpleMuonDigi final - : k4FWCore::MultiTransformer< - std::tuple( - const edm4hep::SimCalorimeterHitCollection&, const edm4hep::EventHeaderCollection&)> { + : k4FWCore::MultiTransformer< + std::tuple( + const edm4hep::SimCalorimeterHitCollection&, const edm4hep::EventHeaderCollection&)> { DDSimpleMuonDigi(const std::string& name, ISvcLocator* svcLoc); StatusCode initialize() override; //StatusCode finalize() override; - std::tuple operator() - (const edm4hep::SimCalorimeterHitCollection& simCaloHits, - const edm4hep::EventHeaderCollection& headers) const override; + std::tuple operator()( + const edm4hep::SimCalorimeterHitCollection& simCaloHits, + const edm4hep::EventHeaderCollection& headers) const override; private: - Gaudi::Property m_subDetName{this, "SubDetectorName", "VXD", "Name of the subdetector"}; + Gaudi::Property m_subDetName{this, "SubDetectorName", "VXD", "Name of the subdetector"}; Gaudi::Property> m_layersToKeepBarrelVec{ - this, "KeepBarrelLayersVec", {0}, "Vector of Barrel layers to be kept. Layers start at 1!"}; + this, "KeepBarrelLayersVec", {0}, "Vector of Barrel layers to be kept. Layers start at 1!"}; Gaudi::Property> m_layersToKeepEndCapVec{ - this, "KeepEndcapLayersVec", {0}, "Vector of Endcap layers to be kept. Layers start at 1!"}; + this, "KeepEndcapLayersVec", {0}, "Vector of Endcap layers to be kept. Layers start at 1!"}; //Gaudi::Property> useLayersBarrelVec{this, "useBarrelLayerVector", false, "whether to use the endcap layer vector"}; //Gaudi::Property> useLayersEndcapVec{this, "useEndCapLayerVector", false, "whether to use the EndCap layer vector"}; - Gaudi::Property m_muonCollections{this, "muonCollections", "muonCollections", "The input collection of Muons"}; + Gaudi::Property m_muonCollections{this, "muonCollections", "muonCollections", + "The input collection of Muons"}; Gaudi::Property outputRelCollection{this, "outputRelCollection", "outputRelCollection", - "The output collection of relations"}; - Gaudi::Property outputMuonCollection{this, "outputMuonCollection","outputMuonCollection", - "The output collection of muons"}; + "The output collection of relations"}; + Gaudi::Property outputMuonCollection{this, "outputMuonCollection", "outputMuonCollection", + "The output collection of muons"}; Gaudi::Property m_encodingStringVariable{ this, "EncodingStringParameterName", "GlobalTrackerReadoutID", "The name of the DD4hep constant that contains the Encoding string for tracking detectors"}; - Gaudi::Property m_cellIDLayerString {this, "CellIDLayerString","Layer", "Name of the part of the cellID that holds the layer"}; - Gaudi::Property m_thresholdMuon{this, "MuonThreshold", {0.025}, "Threshold for muon"}; - Gaudi::Property m_timeThresholdMuon{this, "timethresholdMuon", {0.025}, "time threshold for muons"}; - Gaudi::Property m_calibrCoeffMuon{this, "calibrationCoeffmuon", {120000.0}, "Callibration coefficient of muons"}; + Gaudi::Property m_cellIDLayerString{this, "CellIDLayerString", "Layer", + "Name of the part of the cellID that holds the layer"}; + Gaudi::Property m_thresholdMuon{this, "MuonThreshold", {0.025}, "Threshold for muon"}; + Gaudi::Property m_timeThresholdMuon{this, "timethresholdMuon", {0.025}, "time threshold for muons"}; + Gaudi::Property m_calibrCoeffMuon{ + this, "calibrationCoeffmuon", {120000.0}, "Callibration coefficient of muons"}; Gaudi::Property m_maxHitEnergyMuon{this, "maxMuonHitEnergy", {2.0}, "Threshold for maximum muon hit energy"}; Gaudi::Property m_detectorNameBarrel{this, "detectornameB", "YokeBarrel", "Name of the subdetector"}; Gaudi::Property m_detectorNameEndcap{this, "detectornameE", "YokeEndcap", - "Name of the second subdetector"}; - - std::string m_collName; - std::vector m_useLayersBarrelVec{}, m_useLayersEndcapVec{}; + "Name of the second subdetector"}; + + std::string m_collName; + std::vector m_useLayersBarrelVec{}, m_useLayersEndcapVec{}; SmartIF m_geoSvc; SmartIF m_uidSvc; - bool useLayer(CHT::Layout caloLayout, unsigned int layer) const ; - float computeHitTime( const edm4hep:: SimCalorimeterHit &h ) const ; - + bool useLayer(CHT::Layout caloLayout, unsigned int layer) const; + float computeHitTime(const edm4hep::SimCalorimeterHit& h) const; }; DECLARE_COMPONENT(DDSimpleMuonDigi) #endif diff --git a/k4GaudiPandora/src/CalorimeterHitType.cc b/k4GaudiPandora/src/CalorimeterHitType.cc index a4c4fda..610da06 100644 --- a/k4GaudiPandora/src/CalorimeterHitType.cc +++ b/k4GaudiPandora/src/CalorimeterHitType.cc @@ -1,80 +1,138 @@ +/* + * Copyright (c) 2020-2024 Key4hep-Project. + * + * This file is part of Key4hep. + * See https://key4hep.github.io/key4hep-doc/ for further info. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ #include "CalorimeterHitType.h" #include - /** detailed string for calo type */ -std::ostream& operator<<(std::ostream& os, const CHT& cht){ - os << " calo hit type: " ; - - switch ( cht.caloType() ) { - case CHT::em : os << " em, " ; break ; - case CHT::had : os << " had, " ; break ; - case CHT::muon : os << " muon, " ; break ; - default: os << " - ," ; +std::ostream& operator<<(std::ostream& os, const CHT& cht) { + os << " calo hit type: "; + + switch (cht.caloType()) { + case CHT::em: + os << " em, "; + break; + case CHT::had: + os << " had, "; + break; + case CHT::muon: + os << " muon, "; + break; + default: + os << " - ,"; } - switch ( cht.caloID() ){ - case CHT::ecal : os << "ecal, " ; break ; - case CHT::hcal : os << "hcal, " ; break ; - case CHT::yoke : os << "yoke, " ; break ; - case CHT::lcal : os << "lcal, " ; break ; - case CHT::lhcal : os << "lhcal, " ; break ; - case CHT::bcal : os << "bcal, " ; break ; - default: os << " - ," ; + switch (cht.caloID()) { + case CHT::ecal: + os << "ecal, "; + break; + case CHT::hcal: + os << "hcal, "; + break; + case CHT::yoke: + os << "yoke, "; + break; + case CHT::lcal: + os << "lcal, "; + break; + case CHT::lhcal: + os << "lhcal, "; + break; + case CHT::bcal: + os << "bcal, "; + break; + default: + os << " - ,"; } - switch ( cht.layout() ) { - case CHT::any : os << "any, " ; break ; - case CHT::ring : os << "ring, " ; break ; - case CHT::endcap : os << "endcap, " ; break ; - case CHT::barrel : os << "barrel, " ; break ; - case CHT::plug : os << "plug, " ; break ; - default: os << " - ," ; + switch (cht.layout()) { + case CHT::any: + os << "any, "; + break; + case CHT::ring: + os << "ring, "; + break; + case CHT::endcap: + os << "endcap, "; + break; + case CHT::barrel: + os << "barrel, "; + break; + case CHT::plug: + os << "plug, "; + break; + default: + os << " - ,"; } - os << " layer: " << cht.layer() ; - - return os ; + os << " layer: " << cht.layer(); + + return os; } /** Helper functions that should go to Marlinutil/CalorimeterHitTypes.hh */ -CHT::Layout layoutFromString(const std::string& name){ +CHT::Layout layoutFromString(const std::string& name) { + std::string str(name); + std::transform(str.begin(), str.end(), str.begin(), ::tolower); - std::string str( name ) ; - std::transform( str.begin() , str.end() , str.begin(), ::tolower ) ; - - if( str.find("ring" ) != std::string::npos ) return CHT::ring ; - if( str.find("plug" ) != std::string::npos ) return CHT::plug ; - if( str.find("endcap" ) != std::string::npos ) return CHT::endcap ; - if( str.find("barrel" ) != std::string::npos ) return CHT::barrel ; + if (str.find("ring") != std::string::npos) + return CHT::ring; + if (str.find("plug") != std::string::npos) + return CHT::plug; + if (str.find("endcap") != std::string::npos) + return CHT::endcap; + if (str.find("barrel") != std::string::npos) + return CHT::barrel; std::cout << " not found :" << str << " in " << name << std::endl; - return CHT::any ; + return CHT::any; } -CHT::CaloID caloIDFromString(const std::string& name){ - - std::string str( name ) ; - std::transform( str.begin() , str.end() , str.begin(), ::tolower ) ; - - if( str.find("ecal" ) != std::string::npos ) return CHT::ecal ; - if( str.find("hcal" ) != std::string::npos ) return CHT::hcal ; - if( str.find("yoke" ) != std::string::npos ) return CHT::yoke ; - if( str.find("lcal" ) != std::string::npos ) return CHT::lcal ; - if( str.find("lhcal") != std::string::npos ) return CHT::lhcal ; - if( str.find("bcal" ) != std::string::npos ) return CHT::bcal ; - - return CHT::unknown ; +CHT::CaloID caloIDFromString(const std::string& name) { + std::string str(name); + std::transform(str.begin(), str.end(), str.begin(), ::tolower); + + if (str.find("ecal") != std::string::npos) + return CHT::ecal; + if (str.find("hcal") != std::string::npos) + return CHT::hcal; + if (str.find("yoke") != std::string::npos) + return CHT::yoke; + if (str.find("lcal") != std::string::npos) + return CHT::lcal; + if (str.find("lhcal") != std::string::npos) + return CHT::lhcal; + if (str.find("bcal") != std::string::npos) + return CHT::bcal; + + return CHT::unknown; } -CHT::CaloType caloTypeFromString(const std::string& name){ - - std::string str( name ) ; - std::transform( str.begin() , str.end() , str.begin(), ::tolower ) ; +CHT::CaloType caloTypeFromString(const std::string& name) { + std::string str(name); + std::transform(str.begin(), str.end(), str.begin(), ::tolower); - if( str.find("em" ) != std::string::npos ) return CHT::em ; - if( str.find("had" ) != std::string::npos ) return CHT::had ; - if( str.find("muon" ) != std::string::npos ) return CHT::muon ; + if (str.find("em") != std::string::npos) + return CHT::em; + if (str.find("had") != std::string::npos) + return CHT::had; + if (str.find("muon") != std::string::npos) + return CHT::muon; - // jl: this should probably also have a separate "unknown" or "any" value? - return CHT::em ; + // jl: this should probably also have a separate "unknown" or "any" value? + return CHT::em; } diff --git a/k4GaudiPandora/src/DDSimpleMuonDigi.cc b/k4GaudiPandora/src/DDSimpleMuonDigi.cc index 00e35c2..5c17962 100644 --- a/k4GaudiPandora/src/DDSimpleMuonDigi.cc +++ b/k4GaudiPandora/src/DDSimpleMuonDigi.cc @@ -32,20 +32,17 @@ DECLARE_COMPONENT(DDSimpleMuonDigi) DDSimpleMuonDigi::DDSimpleMuonDigi(const std::string& aName, ISvcLocator* aSvcLoc) : MultiTransformer(aName, aSvcLoc, { - KeyValues("MUONCollection", {"ECalBarrelCollection"}), - KeyValues("HeaderName", {"EventHeader"}), + KeyValues("MUONCollection", {"ECalBarrelCollection"}), + KeyValues("HeaderName", {"EventHeader"}), }, - { - KeyValues("MUONOutputCollections", {"CalorimeterHit"}), - KeyValues("RelationOutputCollection", {"RelationMuonHit"}) - }) { - + {KeyValues("MUONOutputCollections", {"CalorimeterHit"}), + KeyValues("RelationOutputCollection", {"RelationMuonHit"})}) { m_uidSvc = service("UniqueIDGenSvc", true); if (!m_uidSvc) { error() << "Unable to get UniqueIDGenSvc" << endmsg; } - m_geoSvc = serviceLocator()->service("GeoSvc"); // important to initialize m_geoSvc + m_geoSvc = serviceLocator()->service("GeoSvc"); // important to initialize m_geoSvc } StatusCode DDSimpleMuonDigi::initialize() { @@ -83,11 +80,11 @@ StatusCode DDSimpleMuonDigi::initialize() { std::vector layersBarrelVec; layersBarrelVec = std::vector(layersBarrel, 0); if (m_layersToKeepBarrelVec[0] != 0) { - for (auto i : layersBarrelVec) { + for (auto i : layersBarrelVec) { m_useLayersBarrelVec.push_back(false); } for (int k : m_layersToKeepBarrelVec) { - m_useLayersBarrelVec[k-1] = true; + m_useLayersBarrelVec[k - 1] = true; } } // for the check @@ -98,28 +95,28 @@ StatusCode DDSimpleMuonDigi::initialize() { std::vector layersEndcapVec; layersEndcapVec = std::vector(layersEndcap, 0); if (m_layersToKeepEndCapVec[0] != 0) { - for (auto i : layersEndcapVec) { + for (auto i : layersEndcapVec) { m_useLayersEndcapVec.push_back(false); } for (int k : m_layersToKeepEndCapVec) { - m_useLayersEndcapVec[k-1] = true; + m_useLayersEndcapVec[k - 1] = true; } } // just for check //for (auto elem : m_useLayersEndcapVec) { std::cout << "m_useLayersEndCapVec " << elem << std::endl; } } return StatusCode::SUCCESS; -} +} std::tuple DDSimpleMuonDigi::operator()( const edm4hep::SimCalorimeterHitCollection& SimCaloHits, const edm4hep::EventHeaderCollection& headers) const { - debug() << " process event : " << headers[0].getEventNumber() - << " - run " << headers[0].getRunNumber() << endmsg; // headers[0].getRunNumber(),headers[0].getEventNumber() + debug() << " process event : " << headers[0].getEventNumber() << " - run " << headers[0].getRunNumber() + << endmsg; // headers[0].getRunNumber(),headers[0].getEventNumber() auto muoncol = edm4hep::CalorimeterHitCollection(); auto muonRelcol = edm4hep::MCRecoCaloAssociationCollection(); std::string initString; - + std::string colName = m_muonCollections; CHT::Layout caloLayout = layoutFromString(colName); @@ -129,16 +126,17 @@ std::tuple m_maxHitEnergyMuon) { hitEnergy = m_maxHitEnergyMuon; } @@ -154,9 +152,9 @@ std::tuple