145 _zs(iConfig.getUntrackedParameter<
bool>(
"zeroSuppressed",
true)),
159 _nShots = tfserv->
make<TH1F>(
"nShots",
"Number of Shots per event", 200, -0.5, 199.5);
160 _nShots->GetXaxis()->SetTitle(
"Shots");
161 _nShots->GetYaxis()->SetTitle(
"Events");
164 _whichAPV = tfserv->
make<TH1F>(
"whichAPV",
"APV with shots", 6, -0.5, 5.5);
166 _whichAPV->GetYaxis()->SetTitle(
"Shots");
168 _stripMult = tfserv->
make<TH1F>(
"stripMultiplicity",
"Shot Strip Multiplicity", 129, -0.5, 128.5);
169 _stripMult->GetXaxis()->SetTitle(
"Number of Strips");
172 _median = tfserv->
make<TH1F>(
"median",
"APV Shot charge median", 256, -0.5, 255.5);
173 _median->GetXaxis()->SetTitle(
"Charge [ADC]");
174 _median->GetYaxis()->SetTitle(
"Shots");
176 _subDetector = tfserv->
make<TH1F>(
"subDets",
"SubDetector Shot distribution", 10, -0.5, 9.5);
179 _nShotsbxcycle = tfserv->
make<TProfile>(
"nShotsBXcycle",
"Number of shots vs APV cycle bin", 70, -0.5, 69.5);
183 _nShotsdbx = tfserv->
make<TProfile>(
"nShotsDBX",
"Number of shots vs #Delta(BX)", 1000, -0.5, 999.5);
184 _nShotsdbx->GetXaxis()->SetTitle(
"Event #Delta(BX)");
185 _nShotsdbx->GetYaxis()->SetTitle(
"APV shots");
188 tfserv->
make<TProfile>(
"nShotsDBXincycle",
"Number of shots vs #Delta(BX) w.r.t. APV cycle", 1000, -0.5, 999.5);
193 tfserv->
make<TProfile>(
"nShotsBXcycleprev",
"Number of shots vs APV cycle bin of previous L1A", 70, -0.5, 69.5);
198 tfserv->
make<TProfile>(
"nShotsDBXprev",
"Number of shots vs #Delta(BX) of previous L1A", 1000, -0.5, 999.5);
203 "nShotsDBXincycleprev",
"Number of shots vs #Delta(BX) w.r.t. APV cycle of previous L1A", 1000, -0.5, 999.5);
209 _rhm.
makeTProfile(
"nShotsVsTimerun",
"Mean number of shots vs orbit number", 4 * 500, 0, 500 * 262144);
216 _fed = tfserv->
make<TH1F>(
"fed",
"FED Shot distribution", 440, 50, 490);
217 _fed->GetYaxis()->SetTitle(
"Shots");
221 tfserv->
make<TH2F>(
"channelvsfed",
"Channel vs FED Shot distribution", 440, 50, 490, 97, -0.5, 96.5);
226 tfserv->
make<TH2F>(
"nShotsVsFED",
"Number of Shots per event vs fedid", 440, 50, 490, 200, -0.5, 199.5);
228 _nShots->GetYaxis()->SetTitle(
"Shots");
229 _nShots->GetZaxis()->SetTitle(
"Events");
232 _medianVsFED = tfserv->
make<TH2F>(
"medianVsFED",
"APV Shot charge median vs fedid", 440, 50, 490, 256, -0.5, 255.5);
235 _median->GetZaxis()->SetTitle(
"Shots");
267 tkhisto = std::make_unique<TkHistoMap>(tkDetMap,
"ShotMultiplicity",
"ShotMultiplicity", -1);
268 tkhisto2 = std::make_unique<TkHistoMap>(tkDetMap,
"StripMultiplicity",
"StripMultiplicity", -1);
292 std::vector<int> nshotsperFed;
296 nshotsperFed.resize(lNumFeds, 0);
300 const std::vector<APVShot>& shots = apvsf.
getShots();
302 for (std::vector<APVShot>::const_iterator shot = shots.begin(); shot != shots.end(); ++shot) {
303 if (shot->isGenuine()) {
306 uint32_t det = shot->detId();
308 int apvPair = shot->apvNumber() / 2;
316 lChannelId = theConn.
fedCh();
317 thelFEDId = theConn.
fedId();
320 <<
"connection of det " << det <<
" APV pair " << apvPair <<
" not found";
322 LogDebug(
"FED channels") << thelFEDId <<
" " << lChannelId;
329 for (uint32_t ch = 0; ch < conns.size(); ch++) {
330 if (conns[ch] && conns[ch]->isConnected()) {
332 LogDebug(
"ReadyForFEDid") <<
"Ready for FED id " << ch;
333 lFedId = conns[ch]->fedId();
334 LogDebug(
"FEDid") <<
"obtained FED id " << ch <<
" " << lFedId;
338 edm::LogWarning(
"InvalidFEDid") << lFedId <<
" for detid " << det <<
" connection " << ch;
345 edm::LogWarning(
"NoValidFEDid") << lFedId <<
"found for detid " << det;
349 if (lFedId != thelFEDId) {
350 edm::LogWarning(
"FEDidMismatch") <<
" Mismatch in FED id for det " << det <<
" APV pair " << apvPair <<
" : " 351 << lFedId <<
" vs " << thelFEDId;
357 LogDebug(
"ReadyToBeFilled") <<
" ready to be filled with " << thelFEDId <<
" " << lChannelId;
359 LogDebug(
"Filled") <<
" filled with " << thelFEDId <<
" " << lChannelId;
364 (*_fedrun)->Fill(lFedId);
376 (*_whichAPVrun)->Fill(shot->apvNumber());
378 (*_medianrun)->Fill(shot->median());
380 (*_stripMultrun)->Fill(shot->nStrips());
382 (*_subDetectorrun)->Fill(shot->subDet());
384 tkhisto2->fill(det, shot->nStrips());
392 (*_nShotsrun)->Fill(nshots);
404 for (uint16_t lFed(0); lFed < lNumFeds; lFed++) {
405 _nShotsVsFED->Fill(lFed + sistrip::FED_ID_MIN, nshotsperFed[lFed]);
410 (*_nShotsVsTimerun)->Fill(iEvent.
orbitNumber(), nshots);
417 (*_nShotsrun)->GetXaxis()->SetTitle(
"Shots");
418 (*_nShotsrun)->GetYaxis()->SetTitle(
"Events");
419 (*_nShotsrun)->StatOverflows(kTRUE);
423 (*_nShotsVsTimerun)->GetXaxis()->SetTitle(
"Orbit");
424 (*_nShotsVsTimerun)->GetYaxis()->SetTitle(
"Number of Shots");
425 (*_nShotsVsTimerun)->SetCanExtend(TH1::kXaxis);
429 (*_whichAPVrun)->GetXaxis()->SetTitle(
"APV");
430 (*_whichAPVrun)->GetYaxis()->SetTitle(
"Shots");
434 (*_stripMultrun)->GetXaxis()->SetTitle(
"Number of Strips");
435 (*_stripMultrun)->GetYaxis()->SetTitle(
"Shots");
439 (*_medianrun)->GetXaxis()->SetTitle(
"Charge [ADC]");
440 (*_medianrun)->GetYaxis()->SetTitle(
"Shots");
444 (*_subDetectorrun)->GetYaxis()->SetTitle(
"Shots");
449 (*_fedrun)->GetYaxis()->SetTitle(
"Shots");
471 tkmap.
save(
true, 0, 0, tkshotmultmapname);
473 tkmap2.
save(
true, 0, 0, tkstripmultmapname);
std::unique_ptr< TkHistoMap > tkhisto
const FedChannelConnection & getConnection(uint32_t det_id, unsigned short apv_pair) const
static const uint16_t FED_ID_MIN
long long deltaBX(const unsigned int ev2, const unsigned int ev1) const
const uint16_t & fedCh() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TProfile ** _nShotsVsTimerun
void endRun(const edm::Run &, const edm::EventSetup &) override
long long absoluteBXinCycle(const unsigned int ev1, const int bx0) const
T * make(const Args &...args) const
make new ROOT object
const uint16_t & fedId() const
TProfile * _nShotsbxcycleprev
TProfile * _nShotsdbxincycle
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
const std::vector< APVShot > & getShots() const
TH1F ** makeTH1F(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
#define DEFINE_FWK_MODULE(type)
const int getPhase(const std::string partition) const
APVShotsAnalyzer(const edm::ParameterSet &)
edm::EDGetTokenT< EventWithHistory > _historyProductToken
Class containning control, module, detector and connection information, at the level of a FED channel...
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void setPalette(int numpalette)
TProfile * _nShotsbxcycle
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
TProfile ** makeTProfile(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
void beginRun(const edm::Run &, const edm::EventSetup &) override
const SiStripDetCabling * _detCabling
The cabling object.
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
void beginRun(const edm::Run &iRun)
TProfile * _nShotsdbxincycleprev
long long deltaBXinCycle(const unsigned int ev2, const unsigned int ev1, const int bx0) const
const std::string _phasepart
TProfile * _nShotsdbxprev
static const uint16_t FED_ID_MAX
~APVShotsAnalyzer() override
void analyze(const edm::Event &, const edm::EventSetup &) override
std::unique_ptr< TkHistoMap > tkhisto2
edm::EDGetTokenT< APVCyclePhaseCollection > _apvphasecollToken
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > _digicollectionToken
uint32_t _cacheIdDet
DB cache ID used to establish if the cabling has changed during the run.
T const * product() const
void updateDetCabling(const edm::EventSetup &setup)