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));
71 bool switchOffPixelsIfEmpty = (!
pset_.
existsAs<
bool>(
"switchOffPixelsIfEmpty")) ||
73 std::vector<uint32_t> rawInactiveDetIds;
78 rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end());
80 static std::atomic<bool> iFailedAlready{
false};
81 bool expected =
false;
82 if (iFailedAlready.compare_exchange_strong(expected,
true,std::memory_order_acq_rel)){
83 edm::LogError(
"MissingProduct")<<
"I fail to get the list of inactive pixel modules, because of 4.2/4.4 event content change.";
87 if (!rawInactiveDetIds.empty())
std::sort(rawInactiveDetIds.begin(), rawInactiveDetIds.end());
89 int i=0, endDet = thePxDets.
size();
91 for (
auto id : rawInactiveDetIds) {
92 if (
id==idp)
continue;
94 i=thePxDets.
find(
id,i);
95 assert(i!=endDet &&
id == thePxDets.
id(i));
102 if( pixelClusterProducer.empty() ) {
103 if (switchOffPixelsIfEmpty) {
113 if (switchOffPixelsIfEmpty && pixelCollection->
empty()) {
118 pixelClustersToSkip.resize(pixelCollection->
dataSize());
119 std::fill(pixelClustersToSkip.begin(),pixelClustersToSkip.end(),
false);
125 LogDebug(
"MeasurementTracker")<<
"getting pxl refs to skip";
127 if (pixelClusterMask->refProd().
id()!=pixelClusters.
id()){
128 edm::LogError(
"ProductIdMismatch")<<
"The pixel masking does not point to the proper collection of clusters: "<<pixelClusterMask->refProd().
id()<<
"!="<<pixelClusters.
id();
130 pixelClusterMask->copyMaskTo(pixelClustersToSkip);
135 int i = 0, endDet = thePxDets.
size();
138 unsigned int id = set.
id();
139 while (
id != thePxDets.
id(i)) {
141 if (endDet==i)
throw "we have a problem!!!!";
158 std::vector<uint32_t> rawInactiveDetIds;
167 if( !stripClusterProducer.compare(
"") )
return;
169 const int endDet = theStDets.
size();
175 for (
auto id : rawInactiveDetIds) {
176 if (
id==idp)
continue;
178 i=theStDets.
find(
id,i);
179 assert(i!=endDet &&
id == theStDets.
id(i));
193 LogDebug(
"MeasurementTracker")<<
"getting strp refs to skip";
196 if (stripClusterMask->refProd().
id()!=clusterHandle.
id()){
197 edm::LogError(
"ProductIdMismatch")<<
"The strip masking does not point to the proper collection of clusters: "<<stripClusterMask->refProd().
id()<<
"!="<<clusterHandle.
id();
199 stripClusterMask->copyMaskTo(stripClustersToSkip);
202 theStDets.
handle() = clusterHandle;
205 for (
auto j = 0U;
j< (*clusterCollection).size(); ++
j) {
206 unsigned int id = (*clusterCollection).
id(
j);
207 while (
id != theStDets.
id(i)) {
209 if (endDet==i)
throw "we have a problem in strips!!!!";
226 rawInactiveDetIds.insert(rawInactiveDetIds.end(), detIds->begin(), detIds->end());
229 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 existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
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
tuple MeasurementTrackerEvent
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
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 ...
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
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
const edm::ParameterSet & pset_
edm::EDGetTokenT< edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > > thePixelClusterMask
std::string measurementTrackerLabel_
T const * product() const
bool isActive(int i) const
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()
virtual void produce(edm::Event &, const edm::EventSetup &)
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