148 _zs(iConfig.getUntrackedParameter<
bool>(
"zeroSuppressed",
true)),
162 _nShots = tfserv->
make<TH1F>(
"nShots",
"Number of Shots per event",200,-0.5,199.5);
163 _nShots->GetXaxis()->SetTitle(
"Shots");
_nShots->GetYaxis()->SetTitle(
"Events");
166 _whichAPV = tfserv->
make<TH1F>(
"whichAPV",
"APV with shots",6,-0.5,5.5);
169 _stripMult = tfserv->
make<TH1F>(
"stripMultiplicity",
"Shot Strip Multiplicity",129,-0.5,128.5);
170 _stripMult->GetXaxis()->SetTitle(
"Number of Strips");
_stripMult->GetYaxis()->SetTitle(
"Shots");
172 _median = tfserv->
make<TH1F>(
"median",
"APV Shot charge median",256,-0.5,255.5);
173 _median->GetXaxis()->SetTitle(
"Charge [ADC]");
_median->GetYaxis()->SetTitle(
"Shots");
175 _subDetector = tfserv->
make<TH1F>(
"subDets",
"SubDetector Shot distribution",10,-0.5,9.5);
178 _nShotsbxcycle = tfserv->
make<TProfile>(
"nShotsBXcycle",
"Number of shots vs APV cycle bin",70,-0.5,69.5);
181 _nShotsdbx = tfserv->
make<TProfile>(
"nShotsDBX",
"Number of shots vs #Delta(BX)",1000,-0.5,999.5);
182 _nShotsdbx->GetXaxis()->SetTitle(
"Event #Delta(BX)");
_nShotsdbx->GetYaxis()->SetTitle(
"APV shots");
184 _nShotsdbxincycle = tfserv->
make<TProfile>(
"nShotsDBXincycle",
"Number of shots vs #Delta(BX) w.r.t. APV cycle",1000,-0.5,999.5);
187 _nShotsbxcycleprev = tfserv->
make<TProfile>(
"nShotsBXcycleprev",
"Number of shots vs APV cycle bin of previous L1A",70,-0.5,69.5);
190 _nShotsdbxprev = tfserv->
make<TProfile>(
"nShotsDBXprev",
"Number of shots vs #Delta(BX) of previous L1A",1000,-0.5,999.5);
193 _nShotsdbxincycleprev = tfserv->
make<TProfile>(
"nShotsDBXincycleprev",
"Number of shots vs #Delta(BX) w.r.t. APV cycle of previous L1A",1000,-0.5,999.5);
204 _fed = tfserv->
make<TH1F>(
"fed",
"FED Shot distribution",440,50,490);
205 _fed->GetYaxis()->SetTitle(
"Shots");
208 _channelvsfed = tfserv->
make<TH2F>(
"channelvsfed",
"Channel vs FED Shot distribution",440,50,490,97,-0.5,96.5);
212 _nShotsVsFED = tfserv->
make<TH2F>(
"nShotsVsFED",
"Number of Shots per event vs fedid",440,50,490,200,-0.5,199.5);
216 _medianVsFED = tfserv->
make<TH2F>(
"medianVsFED",
"APV Shot charge median vs fedid",440,50,490,256,-0.5,255.5);
255 tkhisto = std::make_unique<TkHistoMap>(tkDetMap,
"ShotMultiplicity",
"ShotMultiplicity",-1);
256 tkhisto2 = std::make_unique<TkHistoMap>(tkDetMap,
"StripMultiplicity",
"StripMultiplicity",-1);
281 std::vector<int> nshotsperFed;
285 nshotsperFed.resize(lNumFeds,0);
289 const std::vector<APVShot>& shots = apvsf.
getShots();
291 for(std::vector<APVShot>::const_iterator shot=shots.begin();shot!=shots.end();++shot) {
292 if(shot->isGenuine()) {
296 uint32_t det=shot->detId();
299 int apvPair = shot->apvNumber()/2;
307 lChannelId = theConn.
fedCh();
308 thelFEDId = theConn.
fedId();
311 edm::LogWarning(
"ConnectionNotFound") <<
"connection of det " << det <<
" APV pair " << apvPair <<
" not found";
313 LogDebug(
"FED channels") << thelFEDId <<
" " << lChannelId ;
317 if (!(conns.size()))
continue;
319 for (uint32_t ch = 0; ch<conns.size(); ch++) {
320 if(conns[ch] && conns[ch]->isConnected()) {
322 LogDebug(
"ReadyForFEDid") <<
"Ready for FED id " << ch;
323 lFedId = conns[ch]->fedId();
324 LogDebug(
"FEDid") <<
"obtained FED id " << ch <<
" " << lFedId;
328 edm::LogWarning(
"InvalidFEDid") << lFedId <<
" for detid " << det <<
" connection " << ch;
335 edm::LogWarning(
"NoValidFEDid") << lFedId <<
"found for detid " << det;
339 if(lFedId != thelFEDId) {
340 edm::LogWarning(
"FEDidMismatch") <<
" Mismatch in FED id for det " << det <<
" APV pair " 341 << apvPair <<
" : " << lFedId <<
" vs " << thelFEDId;
347 LogDebug(
"ReadyToBeFilled") <<
" ready to be filled with " << thelFEDId <<
" " << lChannelId;
349 LogDebug(
"Filled") <<
" filled with " << thelFEDId <<
" " << lChannelId;
372 tkhisto2->fill(det,shot->nStrips());;
393 for (uint16_t lFed(0); lFed<lNumFeds; lFed++){
394 _nShotsVsFED->Fill(lFed+sistrip::FED_ID_MIN,nshotsperFed[lFed]);
411 (*_nShotsrun)->GetXaxis()->SetTitle(
"Shots"); (*_nShotsrun)->GetYaxis()->SetTitle(
"Events");
412 (*_nShotsrun)->StatOverflows(kTRUE);
416 (*_nShotsVsTimerun)->GetXaxis()->SetTitle(
"Orbit"); (*_nShotsVsTimerun)->GetYaxis()->SetTitle(
"Number of Shots");
417 (*_nShotsVsTimerun)->SetCanExtend(TH1::kXaxis);
421 (*_whichAPVrun)->GetXaxis()->SetTitle(
"APV"); (*_whichAPVrun)->GetYaxis()->SetTitle(
"Shots");
425 (*_stripMultrun)->GetXaxis()->SetTitle(
"Number of Strips"); (*_stripMultrun)->GetYaxis()->SetTitle(
"Shots");
429 (*_medianrun)->GetXaxis()->SetTitle(
"Charge [ADC]"); (*_medianrun)->GetYaxis()->SetTitle(
"Shots");
433 (*_subDetectorrun)->GetYaxis()->SetTitle(
"Shots");
438 (*_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
#define DEFINE_FWK_MODULE(type)
TProfile ** _nShotsVsTimerun
void endRun(const edm::Run &, const edm::EventSetup &) override
long long absoluteBXinCycle(const unsigned int ev1, const int bx0) const
def setup(process, global_tag, zero_tesla=False)
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)
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)