11 measurementTrackerLabel_(iConfig.getParameter<std::
string>(
"measurementTracker")),
14 std::vector<edm::InputTag> inactivePixelDetectorTags(iConfig.
getParameter<std::vector<edm::InputTag> >(
"inactivePixelDetectorLabels"));
17 std::vector<edm::InputTag> inactiveStripDetectorTags(iConfig.
getParameter<std::vector<edm::InputTag> >(
"inactiveStripDetectorLabels"));
43 produces<MeasurementTrackerEvent>();
53 auto stripData = std::make_unique<StMeasurementDetSet>(measurementTracker->stripDetConditions());
54 auto pixelData= std::make_unique<PxMeasurementDetSet>(measurementTracker->pixelDetConditions());
55 auto phase2OTData = std::make_unique<Phase2OTMeasurementDetSet>(measurementTracker->phase2DetConditions());
56 std::vector<bool> stripClustersToSkip;
57 std::vector<bool> pixelClustersToSkip;
58 std::vector<bool> phase2ClustersToSkip;
68 std::make_unique<MeasurementTrackerEvent>(*measurementTracker,
69 stripData.release(), pixelData.release(), phase2OTData.release(),
70 stripClustersToSkip, pixelClustersToSkip, phase2ClustersToSkip)
81 std::vector<uint32_t> rawInactiveDetIds;
86 rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end());
88 static std::atomic<bool> iFailedAlready{
false};
89 bool expected =
false;
90 if (iFailedAlready.compare_exchange_strong(expected,
true,std::memory_order_acq_rel)){
91 edm::LogError(
"MissingProduct")<<
"I fail to get the list of inactive pixel modules, because of 4.2/4.4 event content change.";
95 if (!rawInactiveDetIds.empty()) std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end());
97 int i=0, endDet = thePxDets.
size();
99 for (
auto id : rawInactiveDetIds) {
100 if (
id==idp)
continue;
102 i=thePxDets.
find(
id,i);
103 assert(i!=endDet &&
id == thePxDets.
id(i));
110 if( pixelClusterProducer.empty() ) {
111 if (switchOffPixelsIfEmpty) {
122 if (switchOffPixelsIfEmpty && pixelCollection->
empty()) {
127 pixelClustersToSkip.resize(pixelCollection->
dataSize());
128 std::fill(pixelClustersToSkip.begin(),pixelClustersToSkip.end(),
false);
134 LogDebug(
"MeasurementTracker")<<
"getting pxl refs to skip";
136 if (pixelClusterMask->refProd().
id()!=pixelClusters.
id()){
137 edm::LogError(
"ProductIdMismatch")<<
"The pixel masking does not point to the proper collection of clusters: "<<pixelClusterMask->refProd().
id()<<
"!="<<pixelClusters.
id();
139 pixelClusterMask->copyMaskTo(pixelClustersToSkip);
144 int i = 0, endDet = thePxDets.
size();
147 unsigned int id = set.
id();
148 while (
id != thePxDets.
id(i)) {
150 if (endDet==i)
throw "we have a problem!!!!";
167 std::vector<uint32_t> rawInactiveDetIds;
176 if( !stripClusterProducer.compare(
"") )
return;
178 const int endDet = theStDets.
size();
184 for (
auto id : rawInactiveDetIds) {
185 if (
id==idp)
continue;
187 i=theStDets.
find(
id,i);
188 assert(i!=endDet &&
id == theStDets.
id(i));
202 LogDebug(
"MeasurementTracker")<<
"getting strp refs to skip";
205 if (stripClusterMask->refProd().
id()!=clusterHandle.
id()){
206 edm::LogError(
"ProductIdMismatch")<<
"The strip masking does not point to the proper collection of clusters: "<<stripClusterMask->refProd().
id()<<
"!="<<clusterHandle.
id();
208 stripClusterMask->copyMaskTo(stripClustersToSkip);
211 theStDets.
handle() = clusterHandle;
214 for (
auto j = 0U;
j< (*clusterCollection).size(); ++
j) {
215 unsigned int id = (*clusterCollection).
id(
j);
216 while (
id != theStDets.
id(i)) {
218 if (endDet==i)
throw "we have a problem in strips!!!!";
237 if( phase2ClusterProducer.empty() ) {
245 int i = 0, endDet = thePh2OTDets.
size();
249 unsigned int id = set.
id();
250 while (
id != thePh2OTDets.
id(i)) {
252 if (endDet==i)
throw "we have a problem!!!!";
256 thePh2OTDets.
update(i,set);
272 rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end());
275 if (!rawInactiveDetIds.empty()) std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end());
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
size_type dataSize() const
std::vector< edm::EDGetTokenT< DetIdCollection > > theInactiveStripDetectorLabels
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool selfUpdateSkipClusters_
bool isActive(int i) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
MeasurementTrackerEventProducer(const edm::ParameterSet &iConfig)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void updateStrips(const edm::Event &, StMeasurementDetSet &theStDets, std::vector< bool > &stripClustersToSkip) const
void update(int i, const StripDetset &detSet)
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > thePh2OTClusterLabel
const edm::Handle< edmNew::DetSetVector< SiPixelCluster > > & handle() const
tuple pixelClusterProducer
void updatePixels(const edm::Event &, PxMeasurementDetSet &thePxDets, std::vector< bool > &pixelClustersToSkip) const
unsigned int id(int i) const
unsigned int id(int i) const
int find(unsigned int jd, int i=0) const
void setActiveThisEvent(int i, bool active)
Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call ...
tuple stripClusterProducer
void updatePhase2OT(const edm::Event &, Phase2OTMeasurementDetSet &thePh2OTDets) const
const edm::Handle< edmNew::DetSetVector< Phase2TrackerCluster1D > > & handle() const
bool isActive(int i) const
void getInactiveStrips(const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
tuple switchOffPixelsIfEmpty
void updateStacks(const edm::Event &, Phase2OTMeasurementDetSet &theStDets) const
void update(int i, const PixelDetSet &detSet)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual void produce(edm::Event &, const edm::EventSetup &) override
const edm::ParameterSet & pset_
T const * product() const
edm::EDGetTokenT< edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > > thePixelClusterMask
std::string measurementTrackerLabel_
bool isActive(int i) const
void setActiveThisEvent(bool active)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > theStripClusterLabel
int find(unsigned int jd, int i=0) const
void setActiveThisEvent(bool active)
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
unsigned int id(int i) const
void update(int i, const Phase2DetSet &detSet)
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > thePixelClusterLabel
edm::EDGetTokenT< edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > > theStripClusterMask
const_iterator begin(bool update=false) const
std::vector< edm::EDGetTokenT< DetIdCollection > > theInactivePixelDetectorLabels