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"));
38 produces<MeasurementTrackerEvent>();
48 std::auto_ptr<StMeasurementDetSet> stripData(
new StMeasurementDetSet(measurementTracker->stripDetConditions()));
49 std::auto_ptr<PxMeasurementDetSet> pixelData(
new PxMeasurementDetSet(measurementTracker->pixelDetConditions()));
51 std::vector<bool> stripClustersToSkip;
52 std::vector<bool> pixelClustersToSkip;
59 std::auto_ptr<MeasurementTrackerEvent>
out(
new MeasurementTrackerEvent(*measurementTracker, stripData.release(), pixelData.release(), stripClustersToSkip, pixelClustersToSkip));
72 std::vector<uint32_t> rawInactiveDetIds;
77 rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end());
79 static std::atomic<bool> iFailedAlready{
false};
80 bool expected =
false;
81 if (iFailedAlready.compare_exchange_strong(expected,
true,std::memory_order_acq_rel)){
82 edm::LogError(
"MissingProduct")<<
"I fail to get the list of inactive pixel modules, because of 4.2/4.4 event content change.";
86 if (!rawInactiveDetIds.empty()) std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end());
88 int i=0, endDet = thePxDets.
size();
90 for (
auto id : rawInactiveDetIds) {
91 if (
id==idp)
continue;
93 i=thePxDets.
find(
id,i);
94 assert(i!=endDet &&
id == thePxDets.
id(i));
101 if( pixelClusterProducer.empty() ) {
102 if (switchOffPixelsIfEmpty) {
112 if (switchOffPixelsIfEmpty && pixelCollection->
empty()) {
117 pixelClustersToSkip.resize(pixelCollection->
dataSize());
118 std::fill(pixelClustersToSkip.begin(),pixelClustersToSkip.end(),
false);
124 LogDebug(
"MeasurementTracker")<<
"getting pxl refs to skip";
126 if (pixelClusterMask->refProd().
id()!=pixelClusters.
id()){
127 edm::LogError(
"ProductIdMismatch")<<
"The pixel masking does not point to the proper collection of clusters: "<<pixelClusterMask->refProd().
id()<<
"!="<<pixelClusters.
id();
129 pixelClusterMask->copyMaskTo(pixelClustersToSkip);
134 int i = 0, endDet = thePxDets.
size();
137 unsigned int id = set.
id();
138 while (
id != thePxDets.
id(i)) {
140 if (endDet==i)
throw "we have a problem!!!!";
157 std::vector<uint32_t> rawInactiveDetIds;
166 if( !stripClusterProducer.compare(
"") )
return;
168 const int endDet = theStDets.
size();
174 for (
auto id : rawInactiveDetIds) {
175 if (
id==idp)
continue;
177 i=theStDets.
find(
id,i);
178 assert(i!=endDet &&
id == theStDets.
id(i));
192 LogDebug(
"MeasurementTracker")<<
"getting strp refs to skip";
195 if (stripClusterMask->refProd().
id()!=clusterHandle.
id()){
196 edm::LogError(
"ProductIdMismatch")<<
"The strip masking does not point to the proper collection of clusters: "<<stripClusterMask->refProd().
id()<<
"!="<<clusterHandle.
id();
198 stripClusterMask->copyMaskTo(stripClustersToSkip);
201 theStDets.
handle() = clusterHandle;
204 for (
auto j = 0U;
j< (*clusterCollection).size(); ++
j) {
205 unsigned int id = (*clusterCollection).
id(
j);
206 while (
id != theStDets.
id(i)) {
208 if (endDet==i)
throw "we have a problem in strips!!!!";
225 rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end());
228 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
size_type dataSize() const
std::vector< edm::EDGetTokenT< DetIdCollection > > theInactiveStripDetectorLabels
bool selfUpdateSkipClusters_
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)
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool isActive(int i) const
void getInactiveStrips(const edm::Event &event, std::vector< uint32_t > &rawInactiveDetIds) const
tuple switchOffPixelsIfEmpty
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
tuple MeasurementTrackerEvent
void setActiveThisEvent(bool active)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > theStripClusterLabel
int find(unsigned int jd, int i=0) const
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
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