19 #include <ext/algorithm>
23 namespace Phase2Tracker {
31 produces< edm::DetSetVector<Phase2TrackerDigi> >(
"ProcessedRaw");
63 event.getByToken(
token_, buffers );
69 const FEDRawData& fed = buffers->FEDData(fedIndex);
77 std::ostringstream
ss;
78 ss <<
" -------------------------------------------- " << endl;
79 ss <<
" buffer debug ------------------------------- " << endl;
80 ss <<
" -------------------------------------------- " << endl;
81 ss <<
" buffer size : " << buffer->
bufferSize() << endl;
82 ss <<
" fed id : " << fedIndex << endl;
83 ss <<
" -------------------------------------------- " << endl;
84 ss <<
" tracker header debug ------------------------" << endl;
85 ss <<
" -------------------------------------------- " << endl;
86 LogTrace(
"Phase2TrackerDigiProducer") << ss.str(); ss.clear(); ss.str(
"");
90 ss <<
" Mode : " << hex << setw(2) << tr_header.
getDebugMode() << endl;
91 ss <<
" Type : " << hex << setw(2) << (int) tr_header.
getEventType() << endl;
92 ss <<
" Readout : " << hex << setw(2) << tr_header.
getReadoutMode() << endl;
93 ss <<
" Condition Data : " << ( tr_header.
getConditionData() ?
"Present" :
"Absent") <<
"\n";
94 ss <<
" Data Type : " << ( tr_header.
getDataType() ?
"Real" :
"Fake" ) <<
"\n";
95 ss <<
" Status : " << hex << setw(16)<< (int) tr_header.
getGlibStatusCode() << endl;
97 for(
int i=15;
i>=0;
i--)
109 ss <<
" Nr CBC : " << hex << setw(16)<< (int) tr_header.
getNumberOfCBC() << endl;
110 ss <<
" CBC stat : ";
113 ss << hex << setw(2) << (int) tr_header.
CBCStatus()[
i] <<
" ";
116 LogTrace(
"Phase2TrackerDigiProducer") << ss.str(); ss.clear(); ss.str(
"");
117 ss <<
" -------------------------------------------- " << endl;
118 ss <<
" Payload ----------------------------------- " << endl;
119 ss <<
" -------------------------------------------- " << endl;
135 ss <<
dec <<
" id from cabling : " << detid << endl;
136 ss <<
dec <<
" reading channel : " << icbc <<
" on FE " << ife;
137 ss <<
dec <<
" with length : " << (int) channel.
length() << endl;
141 std::vector<Phase2TrackerDigi> stripsTop;
142 std::vector<Phase2TrackerDigi> stripsBottom;
175 LogTrace(
"Phase2TrackerDigiProducer") << ss.str(); ss.clear(); ss.str(
"");
192 std::vector< edm::DetSet<Phase2TrackerDigi> > sorted_and_merged;
200 std::vector<Phase2TrackerDigi> & digis = sorted_and_merged.back().data;
202 size_t len = it->length;
203 for (it2 = it+1; (it2 !=
end) && (it2->detid == it->detid); ++it2) { len += it2->length; }
207 for (it2 = it+0; (it2 !=
end) && (it2->detid == it->detid); ++it2)
215 pr->
swap( proc_raw_dsv );
216 std::auto_ptr< edm::DetSetVector<Phase2TrackerDigi> > pr_dsv(pr);
217 event.put( pr_dsv,
"ProcessedRaw" );
static const char runNumber_[]
const Phase2TrackerCabling * cabling_
T getParameter(std::string const &) const
const Phase2TrackerFEDChannel & channel(const uint8_t internalPhase2TrackerFEDChannelNum) const
const Phase2TrackerModule & findFedCh(std::pair< unsigned int, unsigned int > fedch) const
~Phase2TrackerDigiProducer()
default constructor
size_t bufferSize() const
static const uint16_t CMS_FED_ID_MAX
edm::EDGetTokenT< FEDRawDataCollection > token_
void swap(DetSetVector &other)
size_t size() const
Lenght of the data buffer in bytes.
virtual void produce(edm::Event &, const edm::EventSetup &) override
uint32_t getDetid() const
static const int MAX_CBC_PER_FE
std::vector< Phase2TrackerDigi > proc_work_digis_
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
uint8_t stripIndex() const
std::vector< Registry > proc_work_registry_
virtual void beginJob() override
Phase2TrackerDigiProducer(const edm::ParameterSet &pset)
constructor
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
T const * product() const
virtual void endJob() override
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
static const int STRIPS_PER_CBC
static const uint16_t FED_ID_MIN
Phase2TrackerFEDHeader trackerHeader() const
T mod(const T &a, const T &b)
static const int MAX_FE_PER_FED