|
|
Go to the documentation of this file.
16 #include <sys/types.h>
20 ecalMappingToken_ = esConsumes<EcalElectronicsMapping, EcalMappingRcd, edm::Transition::BeginRun>();
21 channelStatusToken_ = esConsumes<EcalChannelStatusMap, EcalChannelStatusRcd, edm::Transition::BeginRun>();
22 ttMapToken_ = esConsumes<EcalTrigTowerConstituentsMap, IdealGeometryRecord, edm::Transition::BeginRun>();
70 template <
typename CollT,
typename ItemT>
72 typename CollT::const_iterator
res =
std::find(coll.begin(), coll.end(),
item);
73 return (
res != coll.end());
77 std::vector<edm::Handle<EBDetIdCollection>> ebDetIdColls;
78 std::vector<edm::Handle<EEDetIdCollection>> eeDetIdColls;
79 std::vector<edm::Handle<EcalElectronicsIdCollection>> ttColls;
81 auto ebDetIdToRecover = std::make_unique<std::set<EBDetId>>();
82 auto eeDetIdToRecover = std::make_unique<std::set<EEDetId>>();
83 auto ebTTDetIdToRecover = std::make_unique<std::set<EcalTrigTowerDetId>>();
84 auto eeSCDetIdToRecover = std::make_unique<std::set<EcalScDetId>>();
138 const int flag = it->value();
145 for (std::vector<DetId>::const_iterator itId =
vid.begin(); itId !=
vid.end(); ++itId) {
154 const int flag = it->value();
162 std::vector<DetId>
vid;
163 for (
int dx = 1;
dx <= 5; ++
dx) {
164 for (
int dy = 1;
dy <= 5; ++
dy) {
165 const int ix = (scId.ix() - 1) * 5 +
dx;
166 const int iy = (scId.iy() - 1) * 5 +
dy;
167 const int iz = scId.zside();
175 for (std::vector<DetId>::const_iterator itId =
vid.begin(); itId !=
vid.end(); ++itId) {
181 if (ebSrFlags->empty()) {
184 if (eeSrFlags->
empty()) {
198 ebDetIdToRecover->insert(*jt);
206 eeDetIdToRecover->insert(*jt);
218 const int flag = (*chit).getStatusCode();
220 ebDetIdToRecover->insert(*itId);
221 }
else if (
flag == 13 ||
flag == 14) {
222 ebTTDetIdToRecover->insert((*itId).tower());
225 edm::LogError(
"EcalDetIdToBeRecoveredProducer") <<
"No channel status found for xtal " << (*itId).rawId()
226 <<
"! something wrong with EcalChannelStatus in your DB? ";
233 int flag = (*chit).getStatusCode();
235 eeDetIdToRecover->insert(*itId);
236 }
else if (
flag == 13 ||
flag == 14) {
237 eeSCDetIdToRecover->insert(
238 EcalScDetId(1 + ((*itId).ix() - 1) / 5, 1 + ((*itId).iy() - 1) / 5, (*itId).zside()));
241 edm::LogError(
"EcalDetIdToBeRecoveredProducer") <<
"No channel status found for xtal " << (*itId).rawId()
242 <<
"! something wrong with EcalChannelStatus in your DB? ";
247 for (
size_t t = 0;
t < ttColls.size(); ++
t) {
250 for (
size_t i = 0;
i < coll.
size(); ++
i) {
260 for (
size_t j = 0;
j <
vid.size(); ++
j) {
262 if (
include(ebSrpDetId, ebdi)) {
263 ebDetIdToRecover->insert(ebdi);
264 ebTTDetIdToRecover->insert(ebdi.
tower());
270 std::vector<DetId>
vid;
271 for (
int dx = 1;
dx <= 5; ++
dx) {
272 for (
int dy = 1;
dy <= 5; ++
dy) {
273 const int ix = (scId.
ix() - 1) * 5 +
dx;
274 const int iy = (scId.
iy() - 1) * 5 +
dy;
275 const int iz = scId.
zside();
281 for (
size_t j = 0;
j <
vid.size(); ++
j) {
283 if (
include(eeSrpDetId, eedi)) {
284 eeDetIdToRecover->insert(eedi);
290 <<
"Incorrect EcalSubdetector = " << subdet <<
" in EcalElectronicsIdCollection collection ";
317 descriptions.
add(
"ecalDetIdToBeRecovered",
desc);
void push_back(T const &t)
T const * product() const
edm::EDGetTokenT< EcalElectronicsIdCollection > integrityTTIdErrorsToken_
const_iterator end() const
edm::EDGetTokenT< EEDetIdCollection > eeIntegrityChIdErrorsToken_
const_iterator begin() const
edm::EDGetTokenT< EcalElectronicsIdCollection > integrityBlockSizeErrorsToken_
EcalDetIdToBeRecoveredProducer(const edm::ParameterSet &ps)
std::vector< T >::const_iterator const_iterator
std::string scDetIdCollection_
ebIntegrityGainSwitchErrors
edm::EDGetTokenT< EBDetIdCollection > ebIntegrityGainSwitchErrorsToken_
edm::ESGetToken< EcalChannelStatusMap, EcalChannelStatusRcd > channelStatusToken_
edm::ESHandle< EcalTrigTowerConstituentsMap > ttMap_
unsigned ttId(DetId const &)
void produce(edm::Event &evt, const edm::EventSetup &es) final
~EcalDetIdToBeRecoveredProducer() override
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Log< level::Warning, false > LogWarning
edm::EDGetTokenT< EEDetIdCollection > eeIntegrityGainSwitchErrorsToken_
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
std::vector< T >::const_iterator const_iterator
#define DEFINE_FWK_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const_iterator begin() const
std::string ebDetIdCollection_
const_iterator find(uint32_t rawId) const
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
std::string ttDetIdCollection_
edm::EDGetTokenT< EEDetIdCollection > eeIntegrityGainErrorsToken_
std::string eeDetIdCollection_
edm::EDGetTokenT< EBDetIdCollection > ebIntegrityChIdErrorsToken_
const_iterator end() const
DetId getDetId(const EcalElectronicsId &id) const
Get the detid given an electronicsId.
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const EcalChannelStatusMap * chStatus_
Log< level::Error, false > LogError
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
eeIntegrityGainSwitchErrors
void beginRun(edm::Run const &run, const edm::EventSetup &es) final
EcalSubdetector subdet() const
get the subdet
const EcalElectronicsMapping * ecalMapping_
std::vector< DetId > constituentsOf(const EcalTrigTowerDetId &id) const
Get the constituent detids for this tower id.
static const int SRF_FULL
edm::EDGetTokenT< EESrFlagCollection > eeSrFlagToken_
T getParameter(std::string const &) const
edm::EDGetTokenT< EBSrFlagCollection > ebSrFlagToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
bool include(const CollT &coll, const ItemT &item)
std::vector< Item >::const_iterator const_iterator
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > ecalMappingToken_
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecord > ttMapToken_
static const int SRF_FORCED_MASK
edm::EDGetTokenT< EBDetIdCollection > ebIntegrityGainErrorsToken_
const_iterator end() const