46 : conf_(iConfig), show_mechanical_structure_view(
true), show_readout_view(
false), show_control_view(
false), select_all_detectors(
false), reset_each_run(
false), m_cacheID_(0)
156 k0 = ClusterMultiplicityRegions.getParameter<
double>(
"k0");
157 q0 = ClusterMultiplicityRegions.getParameter<
double>(
"q0");
158 dk0 = ClusterMultiplicityRegions.getParameter<
double>(
"dk0");
159 maxClus = ClusterMultiplicityRegions.getParameter<
double>(
"MaxClus");
160 minPix = ClusterMultiplicityRegions.getParameter<
double>(
"MinPix");
245 std::vector<uint32_t> activeDets;
269 edm::LogInfo(
"SiStripTkDQM|SiStripMonitorCluster")<<
"nr. of activeDets: "<<activeDets.size();
270 for(std::vector<uint32_t>::iterator detid_iterator = activeDets.begin(); detid_iterator!=activeDets.end(); detid_iterator++){
271 uint32_t detid = (*detid_iterator);
274 activeDets.erase(detid_iterator);
285 ModuleMEsMap.insert( std::make_pair(detid, mod_single));
289 std::pair<std::string,int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo);
293 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
297 int32_t lnumber = det_layer_pair.second;
298 std::vector<uint32_t> layerDetIds;
299 if (det_layer_pair.first ==
"TIB") {
301 }
else if (det_layer_pair.first ==
"TOB") {
303 }
else if (det_layer_pair.first ==
"TID" && lnumber > 0) {
305 }
else if (det_layer_pair.first ==
"TID" && lnumber < 0) {
307 }
else if (det_layer_pair.first ==
"TEC" && lnumber > 0) {
309 }
else if (det_layer_pair.first ==
"TEC" && lnumber < 0) {
315 folder_organizer.
setLayerFolder(detid,tTopo,det_layer_pair.second);
344 HistoName =
"DeltaBx";
355 HistoName =
"DeltaBxCycle";
381 HistoName =
"AbsoluteBx_CStripVsCpixel";
417 HistoName =
"MainDiagonalPosition_vs_BX";
431 HistoName =
"TH2MainDiagonalPosition_vs_BX";
481 const char*
HistoName =
"StripClusVsBXandOrbit";
482 const char* HistoTitle =
"Strip cluster multiplicity vs BX mod(70) and Orbit;Event 1 BX mod(70);time [Orb#]";
485 ParametersNclusVsCycleTimeProf2D.
getParameter<int32_t>(
"Nbins"),
486 ParametersNclusVsCycleTimeProf2D.
getParameter<
double>(
"xmin"),
487 ParametersNclusVsCycleTimeProf2D.
getParameter<
double>(
"xmax"),
488 ParametersNclusVsCycleTimeProf2D.
getParameter<int32_t>(
"Nbinsy"),
489 ParametersNclusVsCycleTimeProf2D.
getParameter<
double>(
"ymin"),
490 ParametersNclusVsCycleTimeProf2D.
getParameter<
double>(
"ymax"),
497 const char*
HistoName =
"ClusterWidths_vs_Amplitudes";
498 const char* HistoTitle =
"Cluster widths vs amplitudes;Amplitudes (integrated ADC counts);Cluster widths";
500 ParametersClusWidthVsAmpTH2.
getParameter<int32_t>(
"Nbinsx"),
501 ParametersClusWidthVsAmpTH2.
getParameter<
double>(
"xmin"),
502 ParametersClusWidthVsAmpTH2.
getParameter<
double>(
"xmax"),
503 ParametersClusWidthVsAmpTH2.
getParameter<int32_t>(
"Nbinsy"),
504 ParametersClusWidthVsAmpTH2.
getParameter<
double>(
"ymin"),
505 ParametersClusWidthVsAmpTH2.
getParameter<
double>(
"ymax"));
520 HistoName =
"NumberOfClustersInStrip";
530 HistoName =
"NumberOfClustersInStrip_vs_BX";
544 HistoName =
"NumberOfClustersInPixel_vs_BX";
569 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::bookHistograms: " 570 <<
" Creating MEs for new Cabling ";
575 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::bookHistograms: " 576 <<
" Resetting MEs ";
605 int NPixClusters=0, NStripClusters=0, MultiplicityRegion=0;
606 bool isPixValid=
false;
627 if (!cluster_detsetvektor.
isValid())
return;
630 NStripClusters= StrC->
data().size();
632 if (cluster_detsetvektor_pix.
isValid()){
636 MultiplicityRegion=
FindRegion(NStripClusters,NPixClusters);
653 for (std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.begin();
655 iSubdet->second.totNClusters = 0;
659 bool found_layer_me =
false;
665 int ncluster_layer = 0;
666 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_label);
671 layer_single = iLayerME->second;
672 found_layer_me =
true;
676 int ncluster_ring[20] = {0};
678 bool found_module_me =
false;
682 for (std::vector< uint32_t >::const_iterator iterDets = iterLayer->second.begin() ;
683 iterDets != iterLayer->second.end() ; iterDets++) {
686 uint32_t detid = (*iterDets);
689 if (subdet_label.size() == 0) subdet_label = folder_organizer.
getSubDetFolderAndTag(detid, tTopo).second;
694 std::map<uint32_t, ModMEs >::iterator imodME =
ModuleMEsMap.find(detid);
696 mod_single = imodME->second;
697 found_module_me =
true;
699 }
else found_module_me =
false;
703 if(isearch==cluster_detsetvektor->end()){
728 ncluster_layer += cluster_detset.
size();
730 short total_clusterized_strips = 0;
738 const auto & ampls = clusterIter->amplitudes();
740 float cluster_position = clusterIter->barycenter();
742 short cluster_start = clusterIter->firstStrip();
744 short cluster_width = ampls.size();
746 total_clusterized_strips = total_clusterized_strips + cluster_width;
751 float cluster_signal = 0.0;
752 float cluster_noise = 0.0;
753 int nrnonzeroamplitudes = 0;
756 for(uint iamp=0; iamp<ampls.size(); iamp++){
758 cluster_signal += ampls[iamp];
759 if(!qualityHandle->
IsStripBad(qualityRange, clusterIter->firstStrip()+iamp)){
760 noise = noiseHandle->
getNoise(clusterIter->firstStrip()+iamp,detNoiseRange)/gainHandle->
getStripGain(clusterIter->firstStrip()+iamp, detGainRange);
762 noise2 += noise*noise;
763 nrnonzeroamplitudes++;
767 if (nrnonzeroamplitudes > 0) cluster_noise =
sqrt(noise2/nrnonzeroamplitudes);
776 cluster_properties.
charge = cluster_signal;
777 cluster_properties.
position = cluster_position;
778 cluster_properties.
start = cluster_start;
779 cluster_properties.
width = cluster_width;
780 cluster_properties.
noise = cluster_noise;
783 if (found_module_me)
fillModuleMEs(mod_single, cluster_properties);
786 if (found_layer_me) {
794 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
804 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
805 if(iSubdet !=
SubDetMEsMap.end()) iSubdet->second.SubDetClusWidthVsAmpTH2->Fill(cluster_signal, cluster_width);
812 if (
subdetswitchtotclusprofon && (subdet_label.find(
"TID")!=std::string::npos || subdet_label.find(
"TEC")!=std::string::npos)){
813 std::pair<std::string,int32_t> det_ring_pair = folder_organizer.
GetSubDetAndLayer(detid,tTopo,
true);
814 ncluster_ring[
std::abs(det_ring_pair.second)] ++ ;
820 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
821 std::pair<std::string,int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid, tTopo);
822 iSubdet->second.SubDetNumberOfClusterPerLayerTrend->Fill(
trendVar,
std::abs(det_layer_pair.second), ncluster_layer);
825 if (
subdetswitchtotclusprofon && (subdet_label.find(
"TID")!=std::string::npos || subdet_label.find(
"TEC")!=std::string::npos)){
826 std::pair<std::string,int32_t> det_ring_pair = folder_organizer.
GetSubDetAndLayer(detid,tTopo,
true);
831 float local_occupancy =
static_cast<float>(total_clusterized_strips)/static_cast<float>(total_nr_strips);
832 if (found_module_me) {
851 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
852 if(iSubdet !=
SubDetMEsMap.end()) iSubdet->second.totNClusters += ncluster_layer;
870 && apv_phase_collection.
isValid()
874 long long dbx = event_history->
deltaBX();
877 bool global_histo_filled =
false;
878 bool MultiplicityRegion_Vs_APVcycle_filled=
false;
886 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
893 long long tbx_corr = tbx;
903 tbx_corr -= the_phase;
911 global_histo_filled =
true;
916 if (cluster_detsetvektor_pix.
isValid()){
932 if (isPixValid && !MultiplicityRegion_Vs_APVcycle_filled){
935 MultiplicityRegion_Vs_APVcycle_filled=
true;
955 long long tbx_corr = tbx;
956 int the_phase = apv_phase_collection->
getPhase(
"All");
963 tbx_corr -= the_phase;
974 ModMEs mod_me = pos->second;
999 hid = hidmanager.
createHistoId(
"NumberOfClusters",
"det",detid);
1009 hid = hidmanager.
createHistoId(
"ClusterPosition",
"det",detid);
1018 hid = hidmanager.
createHistoId(
"ClusterDigiPosition",
"det",detid);
1034 hid = hidmanager.
createHistoId(
"ClusterCharge",
"det",detid);
1050 hid = hidmanager.
createHistoId(
"ClusterSignalOverNoise",
"det",detid);
1058 hid = hidmanager.
createHistoId(
"ClusterSignalOverNoiseVsPos",
"det",detid);
1074 hid = hidmanager.
createHistoId(
"ClusterLocalOccupancy",
"det",detid);
1082 hid = hidmanager.
createHistoId(
"NrOfClusterizedStrips",
"det",detid);
1089 hid = hidmanager.
createHistoId(
"ClusterWidths_vs_Amplitudes",
"det",detid);
1177 if (label.find(
"TID")!=std::string::npos || label.find(
"TEC")!=std::string::npos){
1231 HistoName =
"ClusterCharge__" +
label;
1238 HistoName =
"ClusterWidth__" +
label;
1245 HistoName =
"TotalNumberOfCluster__" +
label;
1253 HistoName =
"TotalNumberOfClusterProfile__" +
label;
1263 HistoName =
"TotalNumberOfClusterPerLayer__" +
label;
1278 HistoName =
"Cluster_vs_ApvCycle__" +
label;
1293 HistoName =
"Cluster_vs_ApvCycle_2D__" +
label;
1295 double h2ymax = 9999.0;
1296 double yfact = Parameters.
getParameter<
double>(
"yfactor");
1297 if(label.find(
"TIB") != std::string::npos) h2ymax = (6984.*256.)*yfact;
1298 else if (label.find(
"TID") != std::string::npos) h2ymax = (2208.*256.)*yfact;
1299 else if (label.find(
"TOB") != std::string::npos) h2ymax = (12906.*256.)*yfact;
1300 else if (label.find(
"TEC") != std::string::npos) h2ymax = (7552.*2.*256.)*yfact;
1317 HistoName =
"ClusterWidths_vs_Amplitudes__" +
label;
1335 HistoName =
"Cluster_vs_DeltaBxCycle__" +
label;
1349 HistoName =
"DeltaBx_vs_ApvCycle__" +
label;
1376 for(
int ipos=cluster.
start+1; ipos<=cluster.
start+cluster.
width; ipos++){
1385 if (cluster.
noise > 0)
1390 if (cluster.
noise > 0)
1462 return ibooker.
book1D(HistoName,HistoName,
1473 return ibooker.
book2D(HistoName,HistoName,
1486 double kplus=
k0*(1+
dk0/100);
1487 double kminus=
k0*(1-
dk0/100);
1490 if (nstrip!=0 && npix >= (nstrip*kminus-
q0) && npix <=(nstrip*kplus+
q0)) region=1;
1491 else if (nstrip!=0 && npix < (nstrip*kminus-
q0) && nstrip <=
maxClus) region=2;
1492 else if (nstrip!=0 && npix < (nstrip*kminus-
q0) && nstrip >
maxClus) region=3;
1493 else if (nstrip!=0 && npix > (nstrip*kplus+
q0)) region=4;
1494 else if (npix >
minPix && nstrip==0) region=5;
MonitorElement * GlobalABXTH1_CSCP
void ResetModuleMEs(uint32_t idet)
T getParameter(std::string const &) const
TkHistoMap * tkmapclusterch
MonitorElement * LayerNumberOfClusterTrend
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
MonitorElement * NumberOfPixelClus_vs_BX
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
void setSiStripFolderName(std::string name)
MonitorElement * ClusterDigiPosition
long long deltaBX(const unsigned int ev2, const unsigned int ev1) const
MonitorElement * PixVsStripMultiplicityRegions
std::pair< const std::string, const char * > getSubDetFolderAndTag(const uint32_t &detid, const TrackerTopology *tTopo)
MonitorElement * bookProfile(Args &&...args)
MonitorElement * GlobalTH2MainDiagonalPosition_vs_BX
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool moduleswitchclusstonon
MonitorElement * GlobalCStripVsCpix
bool IsStripBad(const uint32_t &detid, const short &strip) const
MonitorElement * SubDetClusterWidthTH1
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)
long long absoluteBX(const unsigned int ev1) const
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
bool module_clusterWidth_vs_amplitude_on
std::map< std::string, LayerMEs > LayerMEsMap
MonitorElement * SubDetClusterApvTH2
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * LayerClusterPosition
bool moduleswitchclusposon
bool layerswitchclusstonon
bool layerswitchnumclusterprofon
bool subdetswitchcluswidthon
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 * LayerClusWidthVsAmpTH2
static float getNoise(uint16_t strip, const Range &range)
MonitorElement * ClusterNoise
MonitorElement * ClusterSignalOverNoise
void createMEs(const edm::EventSetup &es, DQMStore::IBooker &ibooker)
bool moduleswitchcluswidthon
std::map< std::string, std::string > SubDetPhasePartMap
MonitorElement * GlobalApvCycleDBxTH2
const int getPhase(const std::string partition) const
bool globalswitchnclusvscycletimeprof2don
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
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
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
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
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
MonitorElement * bookMETrend(const char *, DQMStore::IBooker &ibooker)
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)
MonitorElement * GlobalMainDiagonalPosition_vs_BX
MonitorElement * SubDetClusterChargeTH1
MonitorElement * NumberOfStripClus_vs_BX
edm::EDGetTokenT< EventWithHistory > historyProducerToken_
MonitorElement * ClusWidthVsAmpTH2
MonitorElement * LayerClusterStoNTrend
MonitorElement * GlobalMainDiagonalPosition
std::string topFolderName_
MonitorElement * bookME2D(const char *ParameterSetLabel, const char *HistoName, DQMStore::IBooker &ibooker)
MonitorElement * SubDetClusterDBxCycleProf
SiStripDCSStatus * dcsStatus_
bool subdetswitchdbxcycleprofon
GenericTriggerEventFlag * genTriggerEventFlagBPTXfilter_
MonitorElement * GlobalDBxTH1
MonitorElement * LayerNumberOfClusterPerRingTrend
bool subdet_clusterWidth_vs_amplitude_on
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
MonitorElement * SubDetClusWidthVsAmpTH2
bool layerswitchclusnoiseon
T const * product() const
MonitorElement * book2D(Args &&...args)
bool layerswitchclusterwidthprofon
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
bool subdetswitchcluschargeon
bool layerswitchlocaloccupancy
bool layer_clusterWidth_vs_amplitude_on
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
long long deltaBXinCycle(const unsigned int ev2, const unsigned int ev1, const int bx0) const
const uint16_t nApvPairs(uint32_t det_id) const
const Range getRange(const uint32_t detID) const
bool layerswitchcluswidthon
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > clusterProducerPixToken_
std::map< std::string, SubDetMEs > SubDetMEsMap
const Range getRange(const uint32_t detID) const
void fillLayerMEs(LayerMEs &, ClusterProperties &cluster)
std::pair< ContainerIterator, ContainerIterator > Range
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
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
MonitorElement * GlobalDBxCycleTH1
edm::EDGetTokenT< APVCyclePhaseCollection > apvPhaseProducerToken_
std::string qualityLabel_
MonitorElement * Module_ClusWidthVsAmpTH2
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
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)
T const * product() const
bool globalswitchmaindiagonalposition
MonitorElement * NclusVsCycleTimeProf2D
bool globalswitchapvcycledbxth2on
void fillModuleMEs(ModMEs &mod_mes, ClusterProperties &cluster)
MonitorElement * SubDetNumberOfClusterPerLayerTrend
bool clusterchtkhistomapon
bool clusterWidth_vs_amplitude_on
MonitorElement * LayerClusterNoiseTrend
const SiStripApvGain::Range getRange(uint32_t detID) const
bool moduleswitchnrclusterizedstrip
bool subdetswitchapvcycleth2on
bool moduleswitchclusdigiposon