152 k0 = ClusterMultiplicityRegions.getParameter<
double>(
"k0");
153 q0 = ClusterMultiplicityRegions.getParameter<
double>(
"q0");
154 dk0 = ClusterMultiplicityRegions.getParameter<
double>(
"dk0");
155 maxClus = ClusterMultiplicityRegions.getParameter<
double>(
"MaxClus");
156 minPix = ClusterMultiplicityRegions.getParameter<
double>(
"MinPix");
230 std::vector<uint32_t> activeDets;
249 edm::LogInfo(
"SiStripTkDQM|SiStripMonitorCluster")<<
"nr. of activeDets: "<<activeDets.size();
250 for(std::vector<uint32_t>::iterator detid_iterator = activeDets.begin(); detid_iterator!=activeDets.end(); detid_iterator++){
251 uint32_t
detid = (*detid_iterator);
254 activeDets.erase(detid_iterator);
265 ModuleMEsMap.insert( std::make_pair(detid, mod_single));
269 std::pair<std::string,int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo);
273 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
277 int32_t lnumber = det_layer_pair.second;
278 std::vector<uint32_t> layerDetIds;
279 if (det_layer_pair.first ==
"TIB") {
281 }
else if (det_layer_pair.first ==
"TOB") {
283 }
else if (det_layer_pair.first ==
"TID" && lnumber > 0) {
285 }
else if (det_layer_pair.first ==
"TID" && lnumber < 0) {
287 }
else if (det_layer_pair.first ==
"TEC" && lnumber > 0) {
289 }
else if (det_layer_pair.first ==
"TEC" && lnumber < 0) {
295 folder_organizer.
setLayerFolder(detid,tTopo,det_layer_pair.second);
411 HistoName =
"NumberOfClustersInStrip";
432 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::bookHistograms: "
433 <<
" Creating MEs for new Cabling ";
438 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::bookHistograms: "
439 <<
" Resetting MEs ";
468 int NPixClusters=0, NStripClusters=0, MultiplicityRegion=0;
469 bool isPixValid=
false;
490 if (!cluster_detsetvektor.
isValid())
return;
493 NStripClusters= StrC->
data().size();
495 if (cluster_detsetvektor_pix.
isValid()){
499 MultiplicityRegion=
FindRegion(NStripClusters,NPixClusters);
515 for (std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.begin();
517 iSubdet->second.totNClusters = 0;
521 bool found_layer_me =
false;
527 int ncluster_layer = 0;
528 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_label);
533 layer_single = iLayerME->second;
534 found_layer_me =
true;
537 bool found_module_me =
false;
541 for (std::vector< uint32_t >::const_iterator iterDets = iterLayer->second.begin() ;
542 iterDets != iterLayer->second.end() ; iterDets++) {
545 uint32_t
detid = (*iterDets);
548 if (subdet_label.size() == 0) subdet_label = folder_organizer.
getSubDetFolderAndTag(detid, tTopo).second;
553 std::map<uint32_t, ModMEs >::iterator imodME =
ModuleMEsMap.find(detid);
555 mod_single = imodME->second;
556 found_module_me =
true;
558 }
else found_module_me =
false;
562 if(isearch==cluster_detsetvektor->end()){
585 ncluster_layer += cluster_detset.
size();
587 short total_clusterized_strips = 0;
595 const std::vector<uint8_t>& ampls = clusterIter->amplitudes();
597 float cluster_position = clusterIter->barycenter();
599 short cluster_start = clusterIter->firstStrip();
601 short cluster_width = ampls.size();
603 total_clusterized_strips = total_clusterized_strips + cluster_width;
606 float cluster_signal = 0.0;
607 float cluster_noise = 0.0;
608 int nrnonzeroamplitudes = 0;
611 for(uint iamp=0; iamp<ampls.size(); iamp++){
613 cluster_signal += ampls[iamp];
614 if(!qualityHandle->IsStripBad(qualityRange, clusterIter->firstStrip()+iamp)){
615 noise = noiseHandle->getNoise(clusterIter->firstStrip()+iamp,detNoiseRange)/gainHandle->getStripGain(clusterIter->firstStrip()+iamp, detGainRange);
617 noise2 += noise*noise;
618 nrnonzeroamplitudes++;
622 if (nrnonzeroamplitudes > 0) cluster_noise =
sqrt(noise2/nrnonzeroamplitudes);
631 cluster_properties.
charge = cluster_signal;
632 cluster_properties.
position = cluster_position;
633 cluster_properties.
start = cluster_start;
634 cluster_properties.
width = cluster_width;
635 cluster_properties.
noise = cluster_noise;
638 if (found_module_me)
fillModuleMEs(mod_single, cluster_properties);
641 if (found_layer_me) {
642 fillLayerMEs(layer_single, cluster_properties, iOrbitSec);
649 float local_occupancy =
static_cast<float>(total_clusterized_strips)/static_cast<float>(total_nr_strips);
650 if (found_module_me) {
664 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
665 if(iSubdet !=
SubDetMEsMap.end()) iSubdet->second.totNClusters += ncluster_layer;
678 && apv_phase_collection.
isValid()
682 long long dbx = event_history->deltaBX();
683 long long tbx = event_history->absoluteBX();
685 bool global_histo_filled =
false;
686 bool MultiplicityRegion_Vs_APVcycle_filled=
false;
688 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
695 long long tbx_corr = tbx;
704 tbx_corr -= the_phase;
705 long long dbxincycle = event_history->deltaBXinCycle(the_phase);
708 global_histo_filled =
true;
711 if (isPixValid && !MultiplicityRegion_Vs_APVcycle_filled){
714 MultiplicityRegion_Vs_APVcycle_filled=
true;
746 std::map<uint32_t, ModMEs >::iterator pos =
ModuleMEsMap.find(idet);
747 ModMEs mod_me = pos->second;
771 hid = hidmanager.
createHistoId(
"NumberOfClusters",
"det",detid);
781 hid = hidmanager.
createHistoId(
"ClusterPosition",
"det",detid);
790 hid = hidmanager.
createHistoId(
"ClusterDigiPosition",
"det",detid);
822 hid = hidmanager.
createHistoId(
"ClusterSignalOverNoise",
"det",detid);
830 hid = hidmanager.
createHistoId(
"ClusterSignalOverNoiseVsPos",
"det",detid);
846 hid = hidmanager.
createHistoId(
"ClusterLocalOccupancy",
"det",detid);
854 hid = hidmanager.
createHistoId(
"NrOfClusterizedStrips",
"det",detid);
943 HistoName =
"TotalNumberOfCluster__" +
label;
951 HistoName =
"TotalNumberOfClusterProfile__" +
label;
966 HistoName =
"Cluster_vs_ApvCycle__" +
label;
981 HistoName =
"Cluster_vs_ApvCycle_2D__" +
label;
983 double h2ymax = 9999.0;
984 double yfact = Parameters.
getParameter<
double>(
"yfactor");
985 if(label.find(
"TIB") != std::string::npos) h2ymax = (6984.*256.)*yfact;
986 else if (label.find(
"TID") != std::string::npos) h2ymax = (2208.*256.)*yfact;
987 else if (label.find(
"TOB") != std::string::npos) h2ymax = (12906.*256.)*yfact;
988 else if (label.find(
"TEC") != std::string::npos) h2ymax = (7552.*2.*256.)*yfact;
1004 HistoName =
"Cluster_vs_DeltaBxCycle__" +
label;
1018 HistoName =
"DeltaBx_vs_ApvCycle__" +
label;
1045 for(
int ipos=cluster.
start+1; ipos<=cluster.
start+cluster.
width; ipos++){
1054 if (cluster.
noise > 0)
1059 if (cluster.
noise > 0)
1101 ParametersTrend.getParameter<int32_t>(
"Nbins"),
1103 ParametersTrend.getParameter<
double>(
"xmin"),
1104 ParametersTrend.getParameter<
double>(
"xmax"),
1107 ParametersTrend.getParameter<
double>(
"ymin"),
1108 ParametersTrend.getParameter<
double>(
"ymax"),
1120 return ibooker.
book1D(HistoName,HistoName,
1129 double kplus=
k0*(1+
dk0/100);
1130 double kminus=
k0*(1-
dk0/100);
1133 if (nstrip!=0 && npix >= (nstrip*kminus-
q0) && npix <=(nstrip*kplus+
q0)) region=1;
1134 else if (nstrip!=0 && npix < (nstrip*kminus-
q0) && nstrip <=
maxClus) region=2;
1135 else if (nstrip!=0 && npix < (nstrip*kminus-
q0) && nstrip >
maxClus) region=3;
1136 else if (nstrip!=0 && npix > (nstrip*kplus+
q0)) region=4;
1137 else if (npix >
minPix && nstrip==0) region=5;
void ResetModuleMEs(uint32_t idet)
T getParameter(std::string const &) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * bookME1D(const char *ParameterSetLabel, const char *HistoName, DQMStore::IBooker &ibooker)
int FindRegion(int nstrip, int npixel)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
MonitorElement * ModuleLocalOccupancy
bool show_mechanical_structure_view
void setSiStripFolderName(std::string name)
MonitorElement * ClusterDigiPosition
MonitorElement * PixVsStripMultiplicityRegions
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
MonitorElement * bookProfile(Args &&...args)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool moduleswitchclusstonon
MonitorElement * GlobalCStripVsCpix
MonitorElement * LayerLocalOccupancyTrend
bool layerswitchclusdigiposon
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=0)
MonitorElement * ClusterSignalOverNoiseVsPos
MonitorElement * LayerClusterNoise
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
bool moduleswitchcluschargeon
bool subdetswitchtotclusth1on
MonitorElement * StripNoise2Cycle
data_type const * const_iterator
MonitorElement * NrOfClusterizedStrips
MonitorElement * LayerClusterStoN
void createLayerMEs(std::string label, int ndets, DQMStore::IBooker &ibooker)
MonitorElement * ClusterPosition
bool layerswitchnrclusterizedstrip
MonitorElement * LayerNumberOfClusterProfile
std::map< std::string, LayerMEs > LayerMEsMap
MonitorElement * SubDetClusterApvTH2
bool moduleswitchclusposon
bool layerswitchclusstonon
bool layerswitchnumclusterprofon
std::map< std::string, std::vector< uint32_t > > LayerDetMap
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * NumberOfPixelClus
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
unsigned long long m_cacheID_
MonitorElement * SubDetApvDBxProf2
void createSubDetMEs(std::string label, DQMStore::IBooker &ibooker)
std::map< uint32_t, ModMEs > ModuleMEsMap
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
MonitorElement * SubDetClusterApvProf
MonitorElement * ClusterNoise
MonitorElement * ClusterSignalOverNoise
void createMEs(const edm::EventSetup &es, DQMStore::IBooker &ibooker)
bool moduleswitchcluswidthon
std::map< std::string, std::string > SubDetPhasePartMap
MonitorElement * GlobalApvCycleDBxTH2
vector< ParameterSet > Parameters
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0) const
MonitorElement * bookProfile2D(Args &&...args)
MonitorElement * LayerLocalOccupancy
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
bool subdetswitchapvcycleprofon
GenericTriggerEventFlag * genTriggerEventFlagPixelDCSfilter_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void fill(uint32_t &detid, float value)
MonitorElement * LayerClusterWidthProfile
void fillLayerMEs(LayerMEs &, ClusterProperties &cluster, float timeinorbit)
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
bool subdetswitchapvcycledbxprof2on
bool layerswitchclusposon
bool moduleswitchclusnoiseon
bool layerswitchcluschargeon
bool layerswitchclusstonVsposon
data_type const * data(size_t cell) const
MonitorElement * book1D(Args &&...args)
bool globalswitchcstripvscpix
void tag(MonitorElement *, unsigned int)
Abs< T >::type abs(const T &t)
std::pair< ContainerIterator, ContainerIterator > Range
bool subdetswitchtotclusprofon
TkHistoMap * tkmapcluster
MonitorElement * NumberOfClusters
MonitorElement * SubDetTotClusterProf
MonitorElement * ClusterCharge
bool globalswitchstripnoise2apvcycle
bool moduleswitchclusstonVsposon
MonitorElement * NumberOfStripClus
Kind kind(void) const
Get the type of the monitor element.
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
edm::EDGetTokenT< EventWithHistory > historyProducerToken_
MonitorElement * bookMETrend(const char *, const char *, DQMStore::IBooker &ibooker)
MonitorElement * LayerClusterStoNTrend
MonitorElement * GlobalMainDiagonalPosition
std::string topFolderName_
MonitorElement * SubDetClusterDBxCycleProf
SiStripDCSStatus * dcsStatus_
bool subdetswitchdbxcycleprofon
GenericTriggerEventFlag * genTriggerEventFlagBPTXfilter_
PixelRecoRange< float > Range
bool globalswitchstripnoise3apvcycle
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=0)
void fillME(MonitorElement *ME, float value1)
SiStripMonitorCluster(const edm::ParameterSet &)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * LayerClusterWidth
MonitorElement * LayerClusterWidthTrend
bool layerswitchclusnoiseon
MonitorElement * book2D(Args &&...args)
bool layerswitchclusterwidthprofon
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
T const * product() const
bool layerswitchlocaloccupancy
T const * product() const
std::pair< std::string, std::string > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
MonitorElement * StripNoise3Cycle
void createModuleMEs(ModMEs &mod_single, uint32_t detid, DQMStore::IBooker &ibooker)
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t petal_bkw_frw=0, uint32_t petal=0, uint32_t ring=0, uint32_t ster=0) const
bool layerswitchcluswidthon
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > clusterProducerPixToken_
std::map< std::string, SubDetMEs > SubDetMEsMap
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0) const
MonitorElement * LayerClusterCharge
MonitorElement * SubDetTotClusterTH1
bool applyClusterQuality_
MonitorElement * ClusterWidth
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterProducerStripToken_
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0) const
MonitorElement * LayerClusterChargeTrend
volatile std::atomic< bool > shutdown_flag false
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
std::pair< ContainerIterator, ContainerIterator > Range
bool globalswitchMultiRegions
bool moduleswitchlocaloccupancy
edm::EDGetTokenT< APVCyclePhaseCollection > apvPhaseProducerToken_
std::string qualityLabel_
GenericTriggerEventFlag * genTriggerEventFlagStripDCSfilter_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
bool globalswitchmaindiagonalposition
bool globalswitchapvcycledbxth2on
void fillModuleMEs(ModMEs &mod_mes, ClusterProperties &cluster)
MonitorElement * LayerClusterNoiseTrend
bool moduleswitchnrclusterizedstrip
bool subdetswitchapvcycleth2on
bool moduleswitchclusdigiposon