|
|
Go to the documentation of this file.
20 #include <sys/types.h>
73 template <
typename CollT,
typename ItemT>
75 typename CollT::const_iterator
res =
std::find(coll.begin(), coll.end(),
item);
76 return (
res != coll.end());
80 std::vector<edm::Handle<EBDetIdCollection>> ebDetIdColls;
81 std::vector<edm::Handle<EEDetIdCollection>> eeDetIdColls;
82 std::vector<edm::Handle<EcalElectronicsIdCollection>> ttColls;
84 auto ebDetIdToRecover = std::make_unique<std::set<EBDetId>>();
85 auto eeDetIdToRecover = std::make_unique<std::set<EEDetId>>();
86 auto ebTTDetIdToRecover = std::make_unique<std::set<EcalTrigTowerDetId>>();
87 auto eeSCDetIdToRecover = std::make_unique<std::set<EcalScDetId>>();
141 const int flag = it->value();
148 for (std::vector<DetId>::const_iterator itId =
vid.begin(); itId !=
vid.end(); ++itId) {
157 const int flag = it->value();
165 std::vector<DetId>
vid;
166 for (
int dx = 1;
dx <= 5; ++
dx) {
167 for (
int dy = 1;
dy <= 5; ++
dy) {
168 const int ix = (scId.ix() - 1) * 5 +
dx;
169 const int iy = (scId.iy() - 1) * 5 +
dy;
170 const int iz = scId.zside();
178 for (std::vector<DetId>::const_iterator itId =
vid.begin(); itId !=
vid.end(); ++itId) {
184 if (ebSrFlags->empty()) {
187 if (eeSrFlags->
empty()) {
201 ebDetIdToRecover->insert(*jt);
209 eeDetIdToRecover->insert(*jt);
221 const int flag = (*chit).getStatusCode();
223 ebDetIdToRecover->insert(*itId);
224 }
else if (
flag == 13 ||
flag == 14) {
225 ebTTDetIdToRecover->insert((*itId).tower());
228 edm::LogError(
"EcalDetIdToBeRecoveredProducer") <<
"No channel status found for xtal " << (*itId).rawId()
229 <<
"! something wrong with EcalChannelStatus in your DB? ";
236 int flag = (*chit).getStatusCode();
238 eeDetIdToRecover->insert(*itId);
239 }
else if (
flag == 13 ||
flag == 14) {
240 eeSCDetIdToRecover->insert(
241 EcalScDetId(1 + ((*itId).ix() - 1) / 5, 1 + ((*itId).iy() - 1) / 5, (*itId).zside()));
244 edm::LogError(
"EcalDetIdToBeRecoveredProducer") <<
"No channel status found for xtal " << (*itId).rawId()
245 <<
"! something wrong with EcalChannelStatus in your DB? ";
250 for (
size_t t = 0;
t < ttColls.size(); ++
t) {
253 for (
size_t i = 0;
i < coll.
size(); ++
i) {
263 for (
size_t j = 0;
j <
vid.size(); ++
j) {
265 if (
include(ebSrpDetId, ebdi)) {
266 ebDetIdToRecover->insert(ebdi);
267 ebTTDetIdToRecover->insert(ebdi.
tower());
273 std::vector<DetId>
vid;
274 for (
int dx = 1;
dx <= 5; ++
dx) {
275 for (
int dy = 1;
dy <= 5; ++
dy) {
276 const int ix = (scId.
ix() - 1) * 5 +
dx;
277 const int iy = (scId.
iy() - 1) * 5 +
dy;
278 const int iz = scId.
zside();
284 for (
size_t j = 0;
j <
vid.size(); ++
j) {
286 if (
include(eeSrpDetId, eedi)) {
287 eeDetIdToRecover->insert(eedi);
293 <<
"Incorrect EcalSubdetector = " << subdet <<
" in EcalElectronicsIdCollection collection ";
320 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_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
EcalDetIdToBeRecoveredProducer(const edm::ParameterSet &ps)
std::vector< T >::const_iterator const_iterator
std::string scDetIdCollection_
edm::EDGetTokenT< EBDetIdCollection > ebIntegrityGainSwitchErrorsToken_
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)
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)
eeIntegrityGainSwitchErrors
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_
ebIntegrityGainSwitchErrors
std::string eeDetIdCollection_
edm::EDGetTokenT< EBDetIdCollection > ebIntegrityChIdErrorsToken_
const_iterator end() const
DetId getDetId(const EcalElectronicsId &id) const
Get the detid given an electronicsId.
const EcalChannelStatusMap * chStatus_
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
T getParameter(std::string const &) const
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_
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
static const int SRF_FORCED_MASK
edm::EDGetTokenT< EBDetIdCollection > ebIntegrityGainErrorsToken_
const_iterator end() const