159 k0 = ClusterMultiplicityRegions.getParameter<
double>(
"k0");
160 q0 = ClusterMultiplicityRegions.getParameter<
double>(
"q0");
161 dk0 = ClusterMultiplicityRegions.getParameter<
double>(
"dk0");
162 maxClus = ClusterMultiplicityRegions.getParameter<
double>(
"MaxClus");
163 minPix = ClusterMultiplicityRegions.getParameter<
double>(
"MinPix");
220 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::beginRun: "
221 <<
" Creating MEs for new Cabling ";
226 edm::LogInfo(
"SiStripMonitorCluster") <<
"SiStripMonitorCluster::beginRun: "
227 <<
" Resetting MEs ";
242 std::vector<uint32_t> activeDets;
259 edm::LogInfo(
"SiStripTkDQM|SiStripMonitorCluster")<<
"nr. of activeDets: "<<activeDets.size();
260 for(std::vector<uint32_t>::iterator detid_iterator = activeDets.begin(); detid_iterator!=activeDets.end(); detid_iterator++){
261 uint32_t
detid = (*detid_iterator);
264 activeDets.erase(detid_iterator);
286 ModuleMEsMap.insert( std::make_pair(detid, mod_single));
290 std::pair<std::string,int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detid);
294 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(label);
298 int32_t lnumber = det_layer_pair.second;
299 std::vector<uint32_t> layerDetIds;
300 if (det_layer_pair.first ==
"TIB") {
302 }
else if (det_layer_pair.first ==
"TOB") {
304 }
else if (det_layer_pair.first ==
"TID" && lnumber > 0) {
306 }
else if (det_layer_pair.first ==
"TID" && lnumber < 0) {
308 }
else if (det_layer_pair.first ==
"TEC" && lnumber > 0) {
310 }
else if (det_layer_pair.first ==
"TEC" && lnumber < 0) {
331 std::string
HistoName =
"DeltaBx_vs_ApvCycle";
346 std::string
HistoName =
"StripClusVsPixClus";
361 std::string
HistoName =
"ClusterMultiplicityRegions";
377 std::string
HistoName =
"MainDiagonal Position";
400 std::string
HistoName =
"StripNoise_ApvCycle";
411 std::string
HistoName =
"HighStripNoise_ApvCycle";
422 std::string
HistoName =
"NumberOfClustersInPixel";
431 HistoName =
"NumberOfClustersInStrip";
461 int NPixClusters=0, NStripClusters=0, MultiplicityRegion=0;
462 bool isPixValid=
false;
483 if (!cluster_detsetvektor.
isValid())
return;
486 NStripClusters= StrC->
data().size();
488 if (cluster_detsetvektor_pix.
isValid()){
492 MultiplicityRegion=
FindRegion(NStripClusters,NPixClusters);
508 for (std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.begin();
510 iSubdet->second.totNClusters = 0;
514 bool found_layer_me =
false;
515 for (
std::map<std::string, std::vector< uint32_t > >::const_iterator iterLayer =
LayerDetMap.begin();
518 std::string layer_label = iterLayer->first;
520 int ncluster_layer = 0;
521 std::map<std::string, LayerMEs>::iterator iLayerME =
LayerMEsMap.find(layer_label);
526 layer_single = iLayerME->second;
527 found_layer_me =
true;
530 bool found_module_me =
false;
532 std::string subdet_label =
"";
534 for (std::vector< uint32_t >::const_iterator iterDets = iterLayer->second.begin() ;
535 iterDets != iterLayer->second.end() ; iterDets++) {
538 uint32_t
detid = (*iterDets);
546 std::map<uint32_t, ModMEs >::iterator imodME =
ModuleMEsMap.find(detid);
548 mod_single = imodME->second;
549 found_module_me =
true;
551 }
else found_module_me =
false;
555 if(isearch==cluster_detsetvektor->end()){
578 ncluster_layer += cluster_detset.
size();
580 short total_clusterized_strips = 0;
588 const std::vector<uint8_t>& ampls = clusterIter->amplitudes();
590 float cluster_position = clusterIter->barycenter();
592 short cluster_start = clusterIter->firstStrip();
594 short cluster_width = ampls.size();
596 total_clusterized_strips = total_clusterized_strips + cluster_width;
599 float cluster_signal = 0.0;
600 float cluster_noise = 0.0;
601 int nrnonzeroamplitudes = 0;
604 for(uint iamp=0; iamp<ampls.size(); iamp++){
606 cluster_signal += ampls[iamp];
607 if(!qualityHandle->IsStripBad(qualityRange, clusterIter->firstStrip()+iamp)){
608 noise = noiseHandle->getNoise(clusterIter->firstStrip()+iamp,detNoiseRange)/gainHandle->getStripGain(clusterIter->firstStrip()+iamp, detGainRange);
610 noise2 += noise*noise;
611 nrnonzeroamplitudes++;
615 if (nrnonzeroamplitudes > 0) cluster_noise =
sqrt(noise2/nrnonzeroamplitudes);
624 cluster_properties.
charge = cluster_signal;
625 cluster_properties.
position = cluster_position;
626 cluster_properties.
start = cluster_start;
627 cluster_properties.
width = cluster_width;
628 cluster_properties.
noise = cluster_noise;
631 if (found_module_me)
fillModuleMEs(mod_single, cluster_properties);
634 if (found_layer_me) {
635 fillLayerMEs(layer_single, cluster_properties, iOrbitSec);
642 float local_occupancy =
static_cast<float>(total_clusterized_strips)/static_cast<float>(total_nr_strips);
643 if (found_module_me) {
657 std::map<std::string, SubDetMEs>::iterator iSubdet =
SubDetMEsMap.find(subdet_label);
658 if(iSubdet !=
SubDetMEsMap.end()) iSubdet->second.totNClusters += ncluster_layer;
671 && apv_phase_collection.
isValid()
675 long long dbx = event_history->deltaBX();
676 long long tbx = event_history->absoluteBX();
678 bool global_histo_filled =
false;
679 bool MultiplicityRegion_Vs_APVcycle_filled=
false;
681 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
683 std::string sdet = it->first;
688 long long tbx_corr = tbx;
697 tbx_corr -= the_phase;
698 long long dbxincycle = event_history->deltaBXinCycle(the_phase);
701 global_histo_filled =
true;
704 if (isPixValid && !MultiplicityRegion_Vs_APVcycle_filled){
707 MultiplicityRegion_Vs_APVcycle_filled=
true;
740 ModMEs mod_me = pos->second;
764 hid = hidmanager.
createHistoId(
"NumberOfClusters",
"det",detid);
774 hid = hidmanager.
createHistoId(
"ClusterPosition",
"det",detid);
783 hid = hidmanager.
createHistoId(
"ClusterDigiPosition",
"det",detid);
815 hid = hidmanager.
createHistoId(
"ClusterSignalOverNoise",
"det",detid);
823 hid = hidmanager.
createHistoId(
"ClusterSignalOverNoiseVsPos",
"det",detid);
839 hid = hidmanager.
createHistoId(
"ClusterLocalOccupancy",
"det",detid);
847 hid = hidmanager.
createHistoId(
"NrOfClusterizedStrips",
"det",detid);
907 std::string hid = hidmanager.
createHistoLayer(
"NumberOfClusterProfile",
"layer",label,
"");
913 std::string hid = hidmanager.
createHistoLayer(
"ClusterWidthProfile",
"layer",label,
"");
936 HistoName =
"TotalNumberOfCluster__" +
label;
944 HistoName =
"TotalNumberOfClusterProfile__" +
label;
959 HistoName =
"Cluster_vs_ApvCycle__" +
label;
974 HistoName =
"Cluster_vs_ApvCycle_2D__" +
label;
976 double h2ymax = 9999.0;
977 double yfact = Parameters.
getParameter<
double>(
"yfactor");
978 if(label.find(
"TIB") != std::string::npos) h2ymax = (6984.*256.)*yfact;
979 else if (label.find(
"TID") != std::string::npos) h2ymax = (2208.*256.)*yfact;
980 else if (label.find(
"TOB") != std::string::npos) h2ymax = (12906.*256.)*yfact;
981 else if (label.find(
"TEC") != std::string::npos) h2ymax = (7552.*2.*256.)*yfact;
997 HistoName =
"Cluster_vs_DeltaBxCycle__" +
label;
1011 HistoName =
"DeltaBx_vs_ApvCycle__" +
label;
1038 for(
int ipos=cluster.
start+1; ipos<=cluster.
start+cluster.
width; ipos++){
1047 if (cluster.
noise > 0)
1052 if (cluster.
noise > 0)
1094 ParametersTrend.getParameter<int32_t>(
"Nbins"),
1096 ParametersTrend.getParameter<
double>(
"xmin"),
1097 ParametersTrend.getParameter<
double>(
"xmax"),
1100 ParametersTrend.getParameter<
double>(
"ymin"),
1101 ParametersTrend.getParameter<
double>(
"ymax"),
1122 double kplus=
k0*(1+
dk0/100);
1123 double kminus=
k0*(1-
dk0/100);
1126 if (nstrip!=0 && npix >= (nstrip*kminus-
q0) && npix <=(nstrip*kplus+
q0)) region=1;
1127 else if (nstrip!=0 && npix < (nstrip*kminus-
q0) && nstrip <=
maxClus) region=2;
1128 else if (nstrip!=0 && npix < (nstrip*kminus-
q0) && nstrip >
maxClus) region=3;
1129 else if (nstrip!=0 && npix > (nstrip*kplus+
q0)) region=4;
1130 else if (npix >
minPix && nstrip==0) region=5;
edm::InputTag clusterProducerStrip_
void ResetModuleMEs(uint32_t idet)
T getParameter(std::string const &) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
int FindRegion(int nstrip, int npixel)
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 * PixVsStripMultiplicityRegions
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
bool moduleswitchclusstonon
MonitorElement * GlobalCStripVsCpix
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
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_
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
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
edm::InputTag clusterProducerPix_
bool layerswitchnumclusterprofon
std::map< std::string, std::vector< uint32_t > > LayerDetMap
MonitorElement * NumberOfPixelClus
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
vector< ParameterSet > Parameters
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
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
bool subdetswitchapvcycleprofon
GenericTriggerEventFlag * genTriggerEventFlagPixelDCSfilter_
MonitorElement * bookMETrend(const char *, const char *)
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
bool globalswitchcstripvscpix
std::pair< ContainerIterator, ContainerIterator > Range
bool subdetswitchtotclusprofon
TkHistoMap * tkmapcluster
MonitorElement * NumberOfClusters
MonitorElement * SubDetTotClusterProf
MonitorElement * ClusterCharge
bool globalswitchstripnoise2apvcycle
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
MonitorElement * NumberOfStripClus
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
MonitorElement * GlobalMainDiagonalPosition
std::string topFolderName_
MonitorElement * SubDetClusterDBxCycleProf
SiStripDCSStatus * dcsStatus_
bool subdetswitchdbxcycleprofon
GenericTriggerEventFlag * genTriggerEventFlagBPTXfilter_
bool globalswitchstripnoise3apvcycle
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
T const * product() const
MonitorElement * StripNoise3Cycle
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
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 * 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_
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 setCurrentFolder(const std::string &fullpath)
void fillModuleMEs(ModMEs &mod_mes, ClusterProperties &cluster)
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