172 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::beginRun: "
173 <<
" Creating MEs for new Cabling ";
178 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::beginRun: "
179 <<
" Resetting MEs ";
194 std::vector<uint32_t> activeDets;
211 edm::LogInfo(
"SiStripTkDQM|SiStripMonitorCluster")<<
"nr. of activeDets: "<<activeDets.size();
212 for(std::vector<uint32_t>::iterator detid_iterator = activeDets.begin(); detid_iterator!=activeDets.end(); detid_iterator++){
213 uint32_t
detid = (*detid_iterator);
216 activeDets.erase(detid_iterator);
238 ModuleMEsMap.insert( std::make_pair(detid, mod_single));
242 std::pair<std::string,int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid);
246 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
250 int32_t lnumber = det_layer_pair.second;
251 std::vector<uint32_t> layerDetIds;
252 if (det_layer_pair.first ==
"TIB") {
254 }
else if (det_layer_pair.first ==
"TOB") {
256 }
else if (det_layer_pair.first ==
"TID" && lnumber > 0) {
258 }
else if (det_layer_pair.first ==
"TID" && lnumber < 0) {
260 }
else if (det_layer_pair.first ==
"TEC" && lnumber > 0) {
262 }
else if (det_layer_pair.first ==
"TEC" && lnumber < 0) {
283 std::string
HistoName =
"DeltaBx_vs_ApvCycle";
324 if (!cluster_detsetvektor.
isValid())
return;
327 for (std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.begin();
329 iSubdet->second.totNClusters = 0;
333 bool found_layer_me =
false;
334 for (
std::map<std::string, std::vector< uint32_t > >::const_iterator iterLayer =
LayerDetMap.begin();
337 std::string layer_label = iterLayer->first;
339 int ncluster_layer = 0;
340 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_label);
345 layer_single = iLayerME->second;
346 found_layer_me =
true;
349 bool found_module_me =
false;
351 std::string subdet_label =
"";
353 for (std::vector< uint32_t >::const_iterator iterDets = iterLayer->second.begin() ;
354 iterDets != iterLayer->second.end() ; iterDets++) {
357 uint32_t
detid = (*iterDets);
365 std::map<uint32_t, ModMEs >::iterator imodME =
ModuleMEsMap.find(detid);
367 mod_single = imodME->second;
368 found_module_me =
true;
370 }
else found_module_me =
false;
374 if(isearch==cluster_detsetvektor->end()){
396 ncluster_layer += cluster_detset.
size();
398 short total_clusterized_strips = 0;
406 const std::vector<uint8_t>& ampls = clusterIter->amplitudes();
408 float cluster_position = clusterIter->barycenter();
410 short cluster_start = clusterIter->firstStrip();
412 short cluster_width = ampls.size();
414 total_clusterized_strips = total_clusterized_strips + cluster_width;
417 float cluster_signal = 0.0;
418 float cluster_noise = 0.0;
419 int nrnonzeroamplitudes = 0;
422 for(uint iamp=0; iamp<ampls.size(); iamp++){
424 cluster_signal += ampls[iamp];
425 if(!qualityHandle->IsStripBad(qualityRange, clusterIter->firstStrip()+iamp)){
426 noise = noiseHandle->getNoise(clusterIter->firstStrip()+iamp,detNoiseRange)/gainHandle->getStripGain(clusterIter->firstStrip()+iamp, detGainRange);
428 noise2 += noise*noise;
429 nrnonzeroamplitudes++;
433 if (nrnonzeroamplitudes > 0) cluster_noise =
sqrt(noise2/nrnonzeroamplitudes);
442 cluster_properties.
charge = cluster_signal;
443 cluster_properties.
position = cluster_position;
444 cluster_properties.
start = cluster_start;
445 cluster_properties.
width = cluster_width;
446 cluster_properties.
noise = cluster_noise;
449 if (found_module_me)
fillModuleMEs(mod_single, cluster_properties);
452 if (found_layer_me) {
453 fillLayerMEs(layer_single, cluster_properties, iOrbitSec);
460 float local_occupancy =
static_cast<float>(total_clusterized_strips)/static_cast<float>(total_nr_strips);
461 if (found_module_me) {
475 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
476 if(iSubdet !=
SubDetMEsMap.end()) iSubdet->second.totNClusters += ncluster_layer;
489 && apv_phase_collection.
isValid()
493 long long dbx = event_history->deltaBX();
494 long long tbx = event_history->absoluteBX();
496 bool global_histo_filled =
false;
497 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
499 std::string sdet = it->first;
504 long long tbx_corr = tbx;
510 tbx_corr -= the_phase;
511 long long dbxincycle = event_history->deltaBXinCycle(the_phase);
514 global_histo_filled =
true;
540 ModMEs mod_me = pos->second;
564 hid = hidmanager.
createHistoId(
"NumberOfClusters",
"det",detid);
574 hid = hidmanager.
createHistoId(
"ClusterPosition",
"det",detid);
583 hid = hidmanager.
createHistoId(
"ClusterDigiPosition",
"det",detid);
615 hid = hidmanager.
createHistoId(
"ClusterSignalOverNoise",
"det",detid);
623 hid = hidmanager.
createHistoId(
"ClusterSignalOverNoiseVsPos",
"det",detid);
639 hid = hidmanager.
createHistoId(
"ClusterLocalOccupancy",
"det",detid);
647 hid = hidmanager.
createHistoId(
"NrOfClusterizedStrips",
"det",detid);
707 std::string hid = hidmanager.
createHistoLayer(
"NumberOfClusterProfile",
"layer",label,
"");
713 std::string hid = hidmanager.
createHistoLayer(
"ClusterWidthProfile",
"layer",label,
"");
736 HistoName =
"TotalNumberOfCluster__" +
label;
744 HistoName =
"TotalNumberOfClusterProfile__" +
label;
759 HistoName =
"Cluster_vs_ApvCycle__" +
label;
774 HistoName =
"Cluster_vs_ApvCycle_2D__" +
label;
776 double h2ymax = 9999.0;
777 double yfact = Parameters.
getParameter<
double>(
"yfactor");
778 if(label.find(
"TIB") != std::string::npos) h2ymax = (6984.*256.)*yfact;
779 else if (label.find(
"TID") != std::string::npos) h2ymax = (2208.*256.)*yfact;
780 else if (label.find(
"TOB") != std::string::npos) h2ymax = (12906.*256.)*yfact;
781 else if (label.find(
"TEC") != std::string::npos) h2ymax = (7552.*2.*256.)*yfact;
797 HistoName =
"Cluster_vs_DeltaBxCycle__" +
label;
811 HistoName =
"DeltaBx_vs_ApvCycle__" +
label;
838 for(
int ipos=cluster.
start+1; ipos<=cluster.
start+cluster.
width; ipos++){
847 if (cluster.
noise > 0)
852 if (cluster.
noise > 0)
894 ParametersTrend.getParameter<int32_t>(
"Nbins"),
896 ParametersTrend.getParameter<
double>(
"xmin"),
897 ParametersTrend.getParameter<
double>(
"xmax"),
900 ParametersTrend.getParameter<
double>(
"ymin"),
901 ParametersTrend.getParameter<
double>(
"ymax"),
void ResetModuleMEs(uint32_t idet)
T getParameter(std::string const &) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
MonitorElement * ModuleLocalOccupancy
bool show_mechanical_structure_view
MonitorElement * bookME1D(const char *ParameterSetLabel, const char *HistoName)
void setSiStripFolderName(std::string name)
MonitorElement * ClusterDigiPosition
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
bool moduleswitchclusstonon
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
MonitorElement * LayerLocalOccupancyTrend
bool layerswitchclusdigiposon
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
MonitorElement * ClusterSignalOverNoiseVsPos
MonitorElement * LayerClusterNoise
bool moduleswitchcluschargeon
bool subdetswitchtotclusth1on
data_type const * const_iterator
MonitorElement * NrOfClusterizedStrips
MonitorElement * LayerClusterStoN
MonitorElement * ClusterPosition
bool layerswitchnrclusterizedstrip
MonitorElement * LayerNumberOfClusterProfile
std::map< std::string, LayerMEs > LayerMEsMap
edm::InputTag apvPhaseProducer_
MonitorElement * SubDetClusterApvTH2
bool moduleswitchclusposon
void createMEs(const edm::EventSetup &es)
bool layerswitchclusstonon
bool layerswitchnumclusterprofon
std::map< std::string, std::vector< uint32_t > > LayerDetMap
unsigned long long m_cacheID_
void tag(MonitorElement *me, unsigned int myTag)
MonitorElement * SubDetApvDBxProf2
std::map< uint32_t, ModMEs > ModuleMEsMap
bool getStatus(edm::Event const &e, edm::EventSetup const &eSetup)
void createSubDetMEs(std::string label)
MonitorElement * SubDetClusterApvProf
MonitorElement * ClusterNoise
MonitorElement * ClusterSignalOverNoise
std::string getSubdetid(uint32_t id, bool flag_ring)
bool moduleswitchcluswidthon
std::map< std::string, std::string > SubDetPhasePartMap
MonitorElement * GlobalApvCycleDBxTH2
std::pair< std::string, std::string > getSubDetFolderAndTag(const uint32_t &detid)
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
void createModuleMEs(ModMEs &mod_single, uint32_t detid)
MonitorElement * LayerLocalOccupancy
bool subdetswitchapvcycleprofon
MonitorElement * bookMETrend(const char *, const char *)
void fill(uint32_t &detid, float value)
MonitorElement * LayerClusterWidthProfile
void fillLayerMEs(LayerMEs &, ClusterProperties &cluster, float timeinorbit)
bool subdetswitchapvcycledbxprof2on
bool layerswitchclusposon
bool moduleswitchclusnoiseon
bool layerswitchcluschargeon
bool layerswitchclusstonVsposon
std::pair< ContainerIterator, ContainerIterator > Range
bool subdetswitchtotclusprofon
TkHistoMap * tkmapcluster
MonitorElement * NumberOfClusters
MonitorElement * SubDetTotClusterProf
MonitorElement * ClusterCharge
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
bool moduleswitchclusstonVsposon
Kind kind(void) const
Get the type of the monitor element.
void setDetectorFolder(uint32_t rawdetid=0)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * LayerClusterStoNTrend
std::string topFolderName_
MonitorElement * SubDetClusterDBxCycleProf
SiStripDCSStatus * dcsStatus_
bool subdetswitchdbxcycleprofon
edm::InputTag clusterProducer_
void fillME(MonitorElement *ME, float value1)
SiStripMonitorCluster(const edm::ParameterSet &)
MonitorElement * LayerClusterWidth
MonitorElement * LayerClusterWidthTrend
bool layerswitchclusnoiseon
bool layerswitchclusterwidthprofon
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
edm::InputTag historyProducer_
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
bool layerswitchlocaloccupancy
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
void createLayerMEs(std::string label, int ndets)
bool layerswitchcluswidthon
std::map< std::string, SubDetMEs > SubDetMEsMap
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
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, bool ring_flag=0)
MonitorElement * SubDetTotClusterTH1
bool applyClusterQuality_
MonitorElement * ClusterWidth
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
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
std::pair< ContainerIterator, ContainerIterator > Range
bool moduleswitchlocaloccupancy
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void setLayerFolder(uint32_t rawdetid=0, int32_t layer=0, bool ring_flag=0)
std::string qualityLabel_
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 globalswitchapvcycledbxth2on
void setCurrentFolder(const std::string &fullpath)
void fillModuleMEs(ModMEs &mod_mes, ClusterProperties &cluster)
std::vector< edm::ParameterSet > Parameters
MonitorElement * LayerClusterNoiseTrend
bool moduleswitchnrclusterizedstrip
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
bool subdetswitchapvcycleth2on
bool moduleswitchclusdigiposon