@@ -334,7 +334,7 @@ void SiStripMonitorCluster::createMEs(const edm::EventSetup& es, DQMStore::IBook
334334 createLayerMEs (label, layerDetIds.size (), ibooker);
335335 }
336336 // book sub-detector plots
337- auto sdet_pair = folder_organizer.getSubDetFolderAndTag (detid, tTopo);
337+ const auto & sdet_pair = folder_organizer.getSubDetFolderAndTag (detid, tTopo);
338338 if (SubDetMEsMap.find (sdet_pair.second ) == SubDetMEsMap.end ()) {
339339 ibooker.setCurrentFolder (sdet_pair.first );
340340
@@ -708,9 +708,8 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
708708 }
709709 }
710710 // initialise # of clusters to zero
711- for (std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.begin (); iSubdet != SubDetMEsMap.end ();
712- iSubdet++) {
713- iSubdet->second .totNClusters = 0 ;
711+ for (auto & iSubdet : SubDetMEsMap) {
712+ iSubdet.second .totNClusters = 0 ;
714713 }
715714
716715 SiStripFolderOrganizer folder_organizer;
@@ -904,7 +903,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
904903 }
905904
906905 if (subdetswitchcluschargeon || subdetswitchcluswidthon) {
907- std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find (subdet_label);
906+ const auto & iSubdet = SubDetMEsMap.find (subdet_label);
908907 if (iSubdet != SubDetMEsMap.end ()) {
909908 if (subdetswitchcluschargeon and passDCSFilter_)
910909 iSubdet->second .SubDetClusterChargeTH1 ->Fill (cluster_signal);
@@ -914,7 +913,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
914913 }
915914
916915 if (subdet_clusterWidth_vs_amplitude_on and passDCSFilter_) {
917- std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find (subdet_label);
916+ const auto & iSubdet = SubDetMEsMap.find (subdet_label);
918917 if (iSubdet != SubDetMEsMap.end ())
919918 iSubdet->second .SubDetClusWidthVsAmpTH2 ->Fill (cluster_signal, cluster_width);
920919 }
@@ -932,7 +931,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
932931 } // end loop over clusters
933932
934933 if (subdetswitchtotclusprofon) {
935- std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find (subdet_label);
934+ const auto & iSubdet = SubDetMEsMap.find (subdet_label);
936935 std::pair<std::string, int32_t > det_layer_pair = folder_organizer.GetSubDetAndLayer (detid, tTopo);
937936 iSubdet->second .SubDetNumberOfClusterPerLayerTrend ->Fill (
938937 trendVar, std::abs (det_layer_pair.second ), ncluster_layer);
@@ -966,7 +965,7 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
966965 if (subdetswitchtotclusprofon)
967966 fillME (layer_single.LayerNumberOfClusterTrend , trendVar, ncluster_layer);
968967
969- std::map<std::string, SubDetMEs>::iterator iSubdet = SubDetMEsMap.find (subdet_label);
968+ const auto & iSubdet = SubDetMEsMap.find (subdet_label);
970969 if (iSubdet != SubDetMEsMap.end ())
971970 iSubdet->second .totNClusters += ncluster_layer;
972971 } // / end of layer loop
@@ -994,10 +993,10 @@ void SiStripMonitorCluster::analyze(const edm::Event& iEvent, const edm::EventSe
994993 }
995994 // plot n 2
996995
997- for (std::map<std::string, SubDetMEs>::iterator it = SubDetMEsMap. begin (); it != SubDetMEsMap. end (); it++ ) {
998- std::string sdet = it-> first ;
996+ for (const auto & it : SubDetMEsMap) {
997+ std::string sdet = std::string (it. first ) ;
999998 // std::string sdet = sdet_tag.substr(0,sdet_tag.find_first_of("_"));
1000- SubDetMEs sdetmes = it-> second ;
999+ SubDetMEs sdetmes = it. second ;
10011000
10021001 int the_phase = APVCyclePhaseCollection::invalid;
10031002 long long tbx_corr = tbx;
@@ -1358,7 +1357,7 @@ void SiStripMonitorCluster::createLayerMEs(std::string label, int ndets, DQMStor
13581357//
13591358// -- Create SubDetector MEs
13601359//
1361- void SiStripMonitorCluster::createSubDetMEs (std::string label, DQMStore::IBooker& ibooker) {
1360+ void SiStripMonitorCluster::createSubDetMEs (std::string_view label, DQMStore::IBooker& ibooker) {
13621361 SubDetMEs subdetMEs;
13631362 subdetMEs.totNClusters = 0 ;
13641363 subdetMEs.SubDetTotClusterTH1 = nullptr ;
@@ -1373,23 +1372,24 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label, DQMStore::IBooker
13731372 subdetMEs.SubDetNumberOfClusterPerLayerTrend = nullptr ;
13741373
13751374 std::string HistoName;
1375+ auto slabel = std::string (label);
13761376 // cluster charge
13771377 if (subdetswitchcluschargeon) {
1378- HistoName = " ClusterCharge__" + label ;
1378+ HistoName = " ClusterCharge__" + slabel ;
13791379 subdetMEs.SubDetClusterChargeTH1 = bookME1D (" TH1ClusterCharge" , HistoName.c_str (), ibooker);
13801380 subdetMEs.SubDetClusterChargeTH1 ->setAxisTitle (" Cluster charge [ADC counts]" );
13811381 subdetMEs.SubDetClusterChargeTH1 ->setStatOverflows (kTRUE ); // over/underflows in Mean calculation
13821382 }
13831383 // cluster width
13841384 if (subdetswitchcluswidthon) {
1385- HistoName = " ClusterWidth__" + label ;
1385+ HistoName = " ClusterWidth__" + slabel ;
13861386 subdetMEs.SubDetClusterWidthTH1 = bookME1D (" TH1ClusterWidth" , HistoName.c_str (), ibooker);
13871387 subdetMEs.SubDetClusterWidthTH1 ->setAxisTitle (" Cluster width [strips]" );
13881388 subdetMEs.SubDetClusterWidthTH1 ->setStatOverflows (kTRUE ); // over/underflows in Mean calculation
13891389 }
13901390 // Total Number of Cluster - 1D
13911391 if (subdetswitchtotclusth1on) {
1392- HistoName = " TotalNumberOfCluster__" + label ;
1392+ HistoName = " TotalNumberOfCluster__" + slabel ;
13931393 subdetMEs.SubDetTotClusterTH1 = bookME1D (" TH1TotalNumberOfClusters" , HistoName.c_str (), ibooker);
13941394 subdetMEs.SubDetTotClusterTH1 ->setAxisTitle (" Total number of clusters in subdetector" );
13951395 subdetMEs.SubDetTotClusterTH1 ->setStatOverflows (kTRUE ); // over/underflows in Mean calculation
@@ -1398,7 +1398,7 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label, DQMStore::IBooker
13981398 if (subdetswitchtotclusprofon) {
13991399 edm::ParameterSet Parameters = trendVs10Ls_ ? conf_.getParameter <edm::ParameterSet>(" TrendingLS" )
14001400 : conf_.getParameter <edm::ParameterSet>(" Trending" );
1401- HistoName = " TotalNumberOfClusterProfile__" + label ;
1401+ HistoName = " TotalNumberOfClusterProfile__" + slabel ;
14021402 subdetMEs.SubDetTotClusterProf = ibooker.bookProfile (HistoName,
14031403 HistoName,
14041404 Parameters.getParameter <int32_t >(" Nbins" ),
@@ -1412,7 +1412,7 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label, DQMStore::IBooker
14121412 subdetMEs.SubDetTotClusterProf ->setCanExtend (TH1::kAllAxes );
14131413
14141414 Parameters = conf_.getParameter <edm::ParameterSet>(" NumberOfClusterPerLayerTrendVar" );
1415- HistoName = " TotalNumberOfClusterPerLayer__" + label ;
1415+ HistoName = " TotalNumberOfClusterPerLayer__" + slabel ;
14161416 subdetMEs.SubDetNumberOfClusterPerLayerTrend = ibooker.bookProfile2D (" NumberOfClusterPerLayerTrendVar" ,
14171417 HistoName.c_str (),
14181418 Parameters.getParameter <int32_t >(" Nbinsx" ),
@@ -1431,7 +1431,7 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label, DQMStore::IBooker
14311431 // Total Number of Cluster vs APV cycle - Profile
14321432 if (subdetswitchapvcycleprofon) {
14331433 edm::ParameterSet Parameters = conf_.getParameter <edm::ParameterSet>(" TProfClustersApvCycle" );
1434- HistoName = " Cluster_vs_ApvCycle__" + label ;
1434+ HistoName = " Cluster_vs_ApvCycle__" + slabel ;
14351435 subdetMEs.SubDetClusterApvProf = ibooker.bookProfile (HistoName,
14361436 HistoName,
14371437 Parameters.getParameter <int32_t >(" Nbins" ),
@@ -1447,17 +1447,17 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label, DQMStore::IBooker
14471447 // Total Number of Clusters vs ApvCycle - 2D
14481448 if (subdetswitchapvcycleth2on) {
14491449 edm::ParameterSet Parameters = conf_.getParameter <edm::ParameterSet>(" TH2ClustersApvCycle" );
1450- HistoName = " Cluster_vs_ApvCycle_2D__" + label ;
1450+ HistoName = " Cluster_vs_ApvCycle_2D__" + slabel ;
14511451 // Adjusting the scale for 2D histogram
14521452 double h2ymax = 9999.0 ;
14531453 double yfact = Parameters.getParameter <double >(" yfactor" );
1454- if (label .find (" TIB" ) != std::string::npos)
1454+ if (slabel .find (" TIB" ) != std::string::npos)
14551455 h2ymax = (6984 . * 256 .) * yfact;
1456- else if (label .find (" TID" ) != std::string::npos)
1456+ else if (slabel .find (" TID" ) != std::string::npos)
14571457 h2ymax = (2208 . * 256 .) * yfact;
1458- else if (label .find (" TOB" ) != std::string::npos)
1458+ else if (slabel .find (" TOB" ) != std::string::npos)
14591459 h2ymax = (12906 . * 256 .) * yfact;
1460- else if (label .find (" TEC" ) != std::string::npos)
1460+ else if (slabel .find (" TEC" ) != std::string::npos)
14611461 h2ymax = (7552 . * 2 . * 256 .) * yfact;
14621462
14631463 subdetMEs.SubDetClusterApvTH2 = ibooker.book2D (HistoName,
@@ -1475,7 +1475,7 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label, DQMStore::IBooker
14751475 // Cluster widths vs amplitudes - 2D
14761476 if (subdet_clusterWidth_vs_amplitude_on) {
14771477 edm::ParameterSet Parameters = conf_.getParameter <edm::ParameterSet>(" ClusWidthVsAmpTH2" );
1478- HistoName = " ClusterWidths_vs_Amplitudes__" + label ;
1478+ HistoName = " ClusterWidths_vs_Amplitudes__" + slabel ;
14791479 subdetMEs.SubDetClusWidthVsAmpTH2 = ibooker.book2D (HistoName,
14801480 HistoName,
14811481 Parameters.getParameter <int32_t >(" Nbinsx" ),
@@ -1491,7 +1491,7 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label, DQMStore::IBooker
14911491 // Total Number of Cluster vs DeltaBxCycle - Profile
14921492 if (subdetswitchdbxcycleprofon) {
14931493 edm::ParameterSet Parameters = conf_.getParameter <edm::ParameterSet>(" TProfClustersVsDBxCycle" );
1494- HistoName = " Cluster_vs_DeltaBxCycle__" + label ;
1494+ HistoName = " Cluster_vs_DeltaBxCycle__" + slabel ;
14951495 subdetMEs.SubDetClusterDBxCycleProf = ibooker.bookProfile (HistoName,
14961496 HistoName,
14971497 Parameters.getParameter <int32_t >(" Nbins" ),
@@ -1506,7 +1506,7 @@ void SiStripMonitorCluster::createSubDetMEs(std::string label, DQMStore::IBooker
15061506 // DeltaBx vs ApvCycle - 2DProfile
15071507 if (subdetswitchapvcycledbxprof2on) {
15081508 edm::ParameterSet Parameters = conf_.getParameter <edm::ParameterSet>(" TProf2ApvCycleVsDBx" );
1509- HistoName = " DeltaBx_vs_ApvCycle__" + label ;
1509+ HistoName = " DeltaBx_vs_ApvCycle__" + slabel ;
15101510 subdetMEs.SubDetApvDBxProf2 = ibooker.bookProfile2D (HistoName,
15111511 HistoName,
15121512 Parameters.getParameter <int32_t >(" Nbinsx" ),
0 commit comments