53 "\n------------------------------------------"
54 "\nUnAvailable Service DQMStore: please insert in the configuration file an instance like" "\n\tprocess.load(\"DQMServices.Core.DQMStore_cfg\")" "\n------------------------------------------";
63 "\n------------------------------------------"
64 "\nUnAvailable Service TkHistoMap: please insert in the configuration file an instance like" "\n\tprocess.TkDetMap = cms.Service(\"TkDetMap\")" "\n------------------------------------------";
105 float phiWeight = 1.;
121 #ifdef THIS_IS_AN_EVENT_EXAMPLE
126 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
128 iSetup.
get < SetupRecord > ().
get (pSetup);
136 LogDebug (
"SiStripMonitorHLTMuon") <<
" processing conterEvt_: " <<
counterEvt_ << std::endl;
149 bool accessToL3Muons =
true;
151 reco::RecoChargedCandidateCollection::const_iterator cand;
155 bool accessToClusters =
true;
161 bool accessToTracks =
true;
163 reco::TrackCollection::const_iterator
track;
169 for (clust = clusters->begin_record (); clust != clusters->end_record (); ++clust)
172 uint detID = clust->geographicalId ();
173 std::stringstream ss;
179 LocalPoint clustlp = topol->localPosition (clust->barycenter ());
183 float etaWeight = 1.;
184 float phiWeight = 1.;
189 LayerMEMap[label.c_str ()].EtaDistribAllClustersMap->Fill (clustgp.
eta (),etaWeight);
190 LayerMEMap[label.c_str ()].PhiDistribAllClustersMap->Fill (clustgp.
phi (),phiWeight);
191 LayerMEMap[label.c_str ()].EtaPhiAllClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
198 for (cand = l3mucands->begin (); cand != l3mucands->end (); ++cand)
207 for (track = trackCollection->begin (); track != trackCollection->end() ; ++
track)
223 uint detID = l3tk->
recHit (
hit)->geographicalId ()();
253 float etaWeight = 1.;
254 float phiWeight = 1.;
260 LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
261 LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
262 LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
266 LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
267 LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
268 LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
277 if (hit2D->cluster_regional ().isNonnull ())
279 if (hit2D->cluster_regional ().isAvailable ())
281 detID = hit2D->cluster_regional ()->geographicalId ();
297 float etaWeight = 1.;
298 float phiWeight = 1.;
304 LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
305 LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
306 LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
310 LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
311 LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
312 LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
319 if (hitMatched2D != 0)
322 if (hitMatched2D->monoHit ()->cluster_regional ().isNonnull ())
324 if (hitMatched2D->monoHit ()->cluster_regional ().isAvailable ())
326 detID = hitMatched2D->monoHit ()->cluster_regional ()->geographicalId ();
341 float etaWeight = 1.;
342 float phiWeight = 1.;
348 LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
349 LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
350 LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
354 LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
355 LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
356 LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
363 if (hitMatched2D->stereoHit ()->cluster_regional ().isNonnull ())
365 if (hitMatched2D->stereoHit ()->cluster_regional ().isAvailable ())
367 detID = hitMatched2D->stereoHit ()->cluster_regional ()->geographicalId ();
373 if (theGeomDet2 != 0)
382 float etaWeight = 1.;
383 float phiWeight = 1.;
389 LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
390 LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
391 LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
395 LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
396 LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
397 LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
408 if (hitProj2D->originalHit ().cluster_regional ().isNonnull ())
410 if (hitProj2D->originalHit ().cluster_regional ().isAvailable ())
412 detID = hitProj2D->originalHit ().cluster_regional ()->geographicalId ();
427 float etaWeight = 1.;
428 float phiWeight = 1.;
434 LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
435 LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
436 LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
440 LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
441 LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
442 LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
458 std::vector <float *> tgraphEta;
459 std::vector <float *> tgraphPhi;
460 std::vector <int> tgraphSize;
462 std::vector <std::vector<float> > binningEta;
463 std::vector <std::vector<float> > binningPhi;
465 for (
int p = 0;
p < 34;
p++){
466 tgraphEta.push_back (
new float[1000]);
467 tgraphPhi.push_back (
new float[1000]);
471 std::map< std::string,std::vector<float> > m_BinEta_Prel ;
472 std::map< std::string,std::vector<float> > m_PhiStripMod_Eta;
473 std::map< std::string,std::vector<float> > m_PhiStripMod_Nb;
483 std::vector<DetId> Dets = theTracker.
detUnitIds();
504 std::stringstream ss;
506 uint32_t subdetlayer, side;
523 std::string histoname;
527 std::string labelHisto_ID = labelHisto;
528 labelHisto_ID.erase(3);
531 unsigned int sizePhi = 0;
532 unsigned int sizeEta = 0;
533 float * xbinsPhi =
new float[100];
534 float * xbinsEta =
new float[100];
537 if (labelHisto_ID ==
"TEC" || labelHisto_ID ==
"TID" || labelHisto_ID ==
"TOB" || labelHisto_ID ==
"TIB"){
547 sizePhi =
m_BinPhi[labelHisto].size();
549 for (
unsigned int i = 0;
i < sizePhi;
i++){
554 std::vector <float > v_BinEta_Prel;
556 for (
unsigned int i = 0;
i < 12;
i++){
558 if (m_PhiStripMod_Nb[labelHisto][
i] != 0 && fabs(m_PhiStripMod_Eta[labelHisto][
i]) > 0.05){
559 float EtaBarycenter = m_PhiStripMod_Eta[labelHisto][
i]/m_PhiStripMod_Nb[labelHisto][
i];
560 v_BinEta_Prel.push_back(EtaBarycenter);
565 sort(v_BinEta_Prel.begin(),v_BinEta_Prel.end());
568 for (
unsigned int i = 0;
i < v_BinEta_Prel.size();
i++){
569 if (
i == 0)
m_BinEta[labelHisto].push_back(v_BinEta_Prel[
i] - 0.15);
571 float shift = v_BinEta_Prel[
i] - v_BinEta_Prel[
i-1];
572 m_BinEta[labelHisto].push_back(v_BinEta_Prel[
i] - shift/2.);
574 if (
i == v_BinEta_Prel.size()-1)
m_BinEta[labelHisto].push_back(v_BinEta_Prel[
i] + 0.15);
580 sizeEta =
m_BinEta[labelHisto].size();
582 for (
unsigned int i = 0;
i < sizeEta;
i++){
590 histoname =
"EtaAllClustersDistrib_" + labelHisto;
591 title =
"#eta(All Clusters) in " + labelHisto;
593 histoname =
"PhiAllClustersDistrib_" + labelHisto;
594 title =
"#phi(All Clusters) in " + labelHisto;
596 histoname =
"EtaPhiAllClustersMap_" + labelHisto;
597 title =
"#eta-#phi All Clusters map in " + labelHisto;
602 histoname =
"EtaOnTrackClustersDistrib_" + labelHisto;
603 title =
"#eta(OnTrack Clusters) in " + labelHisto;
605 histoname =
"PhiOnTrackClustersDistrib_" + labelHisto;
606 title =
"#phi(OnTrack Clusters) in " + labelHisto;
608 histoname =
"EtaPhiOnTrackClustersMap_" + labelHisto;
609 title =
"#eta-#phi OnTrack Clusters map in " + labelHisto;
614 histoname =
"EtaL3MuTrackClustersDistrib_" + labelHisto;
615 title =
"#eta(L3MuTrack Clusters) in " + labelHisto;
617 histoname =
"PhiL3MuTrackClustersDistrib_" + labelHisto;
618 title =
"#phi(L3MuTrack Clusters) in " + labelHisto;
620 histoname =
"EtaPhiL3MuTrackClustersMap_" + labelHisto;
621 title =
"#eta-#phi L3MuTrack Clusters map in " + labelHisto;
628 LayerMEMap[labelHisto].EtaDistribAllClustersMap->getTH1F()->Sumw2();
629 LayerMEMap[labelHisto].PhiDistribAllClustersMap->getTH1F()->Sumw2();
630 LayerMEMap[labelHisto].EtaPhiAllClustersMap->getTH2F()->Sumw2();
633 LayerMEMap[labelHisto].EtaDistribOnTrackClustersMap->getTH1F()->Sumw2();
634 LayerMEMap[labelHisto].PhiDistribOnTrackClustersMap->getTH1F()->Sumw2();
635 LayerMEMap[labelHisto].EtaPhiOnTrackClustersMap->getTH2F()->Sumw2();
638 LayerMEMap[labelHisto].EtaDistribL3MuTrackClustersMap->getTH1F()->Sumw2();
639 LayerMEMap[labelHisto].PhiDistribL3MuTrackClustersMap->getTH1F()->Sumw2();
640 LayerMEMap[labelHisto].EtaPhiL3MuTrackClustersMap->getTH2F()->Sumw2();
655 std::map< std::string,std::vector<float> > & m_PhiStripMod_Eta,
std::map< std::string,std::vector<float> > & m_PhiStripMod_Nb){
658 std::vector<std::string> v_LabelHisto;
662 for(std::vector<DetId>::iterator detid_iterator = Dets.begin(); detid_iterator!=Dets.end(); detid_iterator++){
663 uint32_t
detid = (*detid_iterator)();
665 if ( (*detid_iterator).null() ==
true)
break;
666 if (detid == 0)
break;
673 std::string mylabelHisto;
686 LocalPoint clustlp = topol->localPosition (1.);
698 unsigned int count = 0;
699 while (count < v_LabelHisto.size()){
700 if (mylabelHisto == v_LabelHisto[count])
break;
703 if (count == v_LabelHisto.size()){
706 v_LabelHisto.push_back(mylabelHisto);
711 for (
int i = 0;
i < 12;
i++){
712 m_PhiStripMod_Eta[mylabelHisto].push_back(0.);
713 m_PhiStripMod_Nb[mylabelHisto].push_back(0.);
734 m_PhiStripMod_Eta[mylabelHisto][
id.ringNumber()-1] = m_PhiStripMod_Eta[mylabelHisto][
id.ringNumber()-1] + clustgp.
eta();
735 m_PhiStripMod_Nb[mylabelHisto][
id.ringNumber()-1]++;
749 if (
id.isFrontRing() ==
true &&
id.isStereo() ==
false)
m_BinPhi[mylabelHisto].push_back(clustgp.
phi());
751 if (
id.isFrontRing() ==
true &&
id.isStereo() ==
true)
m_BinPhi[mylabelHisto].push_back(clustgp.
phi());
757 m_PhiStripMod_Eta[mylabelHisto][
id.ringNumber()-1] = m_PhiStripMod_Eta[mylabelHisto][
id.ringNumber()-1] + clustgp.
eta();
758 m_PhiStripMod_Nb[mylabelHisto][
id.ringNumber()-1]++;
769 if (
id.
moduleNumber() == 1 &&
id.isZMinusSide() ==
true){
771 if (
id.isStereo() ==
false)
m_BinPhi[mylabelHisto].push_back(clustgp.
phi());
776 if ( (
id.
rodNumber() == 2 &&
id.isStereo() ==
false)
777 || (
id.rodNumber() == 1 &&
id.isStereo() ==
true)
779 if (
id.isZMinusSide() ==
true){
780 m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()-1] = m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()-1] + clustgp.
eta();
781 m_PhiStripMod_Nb[mylabelHisto][
id.moduleNumber()-1]++;
783 if (
id.isZMinusSide() ==
false){
784 m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+5] = m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+5] + clustgp.
eta();
785 m_PhiStripMod_Nb[mylabelHisto][
id.moduleNumber()+5]++;
798 if (
id.
moduleNumber() == 1 &&
id.isZMinusSide() ==
true){
800 if (
id.isInternalString() ==
true &&
id.isStereo() ==
false)
m_BinPhi[mylabelHisto].push_back(clustgp.
phi());
806 || (
id.stringNumber() == 1 &&
id.isStereo() ==
true)
808 if (
id.isZMinusSide() ==
true){
809 if (
id.isInternalString() ==
true){
810 m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()-1] = m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()-1] + clustgp.
eta();
811 m_PhiStripMod_Nb[mylabelHisto][
id.moduleNumber()-1]++;
813 if (
id.isInternalString() ==
false){
814 m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+2] = m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+2] + clustgp.
eta();
815 m_PhiStripMod_Nb[mylabelHisto][
id.moduleNumber()+2]++;
818 if (
id.isZMinusSide() ==
false){
819 if (
id.isInternalString() ==
true){
820 m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+5] = m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+5] + clustgp.
eta();
821 m_PhiStripMod_Nb[mylabelHisto][
id.moduleNumber()+5]++;
823 if (
id.isInternalString() ==
false){
824 m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+8] = m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+8] + clustgp.
eta();
825 m_PhiStripMod_Nb[mylabelHisto][
id.moduleNumber()+8]++;
843 std::vector<std::string> v_LabelHisto;
847 for(std::vector<DetId>::iterator detid_iterator = Dets.begin(); detid_iterator!=Dets.end(); detid_iterator++){
848 uint32_t
detid = (*detid_iterator)();
850 if ( (*detid_iterator).null() ==
true)
break;
851 if (detid == 0)
break;
858 std::string mylabelHisto;
879 unsigned int count = 0;
881 while (count < v_LabelHisto.size()){
882 if (mylabelHisto == v_LabelHisto[count])
break;
886 if (count == v_LabelHisto.size()){
888 v_LabelHisto.push_back(mylabelHisto);
892 for (
unsigned int i = 0;
i <
m_BinEta[mylabelHisto].size() -1;
i++){
897 for (
unsigned int i = 0;
i <
m_BinPhi[mylabelHisto].size() -1;
i++){
903 LocalPoint clustlp_1 = topol->localPosition (1.);
911 LocalPoint Border_clustlp = topol->localPosition (topol->nstrips());
918 std::string labelHisto_ID = mylabelHisto;
919 labelHisto_ID.erase(3);
924 std::vector <GlobalPoint> v_Edge_G;
930 if (labelHisto_ID ==
"TOB" || labelHisto_ID ==
"TIB"){
932 length = rectangularBound->
length();
933 width = rectangularBound->
width();
934 ratio = width/length;
945 if (labelHisto_ID ==
"TEC" || labelHisto_ID ==
"TID"){
948 length = trapezoidalBound->
length();
951 ratio = width/length;
971 std::vector <bool> v_Fill;
972 v_Fill.push_back(
false);
973 v_Fill.push_back(
false);
974 v_Fill.push_back(
false);
975 v_Fill.push_back(
false);
977 for (
unsigned int i =0 ;
i< v_Edge_G.size() ;
i++){
978 if (v_Edge_G[
i].
eta() < clustgp.
eta()){
979 if (v_Edge_G[
i].
phi() < clustgp.
phi()) {
980 bot_left_G = v_Edge_G[
i];
983 if (v_Edge_G[
i].
phi() > clustgp.
phi()){
984 top_left_G = v_Edge_G[
i];
988 if (v_Edge_G[
i].
eta() > clustgp.
eta()){
989 if (v_Edge_G[
i].
phi() < clustgp.
phi()){
990 bot_rightG = v_Edge_G[
i];
993 if (v_Edge_G[
i].
phi() > clustgp.
phi()){
994 top_rightG = v_Edge_G[
i];
1002 float G_length = 0.;
1005 bool flag_border =
false;
1007 if (v_Fill[0] ==
true
1008 && v_Fill[1] ==
true
1009 && v_Fill[2] ==
true
1010 && v_Fill[3] ==
true){
1013 G_length =
sqrt( (top_left_G.
x()-top_rightG.
x())*(top_left_G.
x()-top_rightG.
x()) + (top_left_G.
y()-top_rightG.
y())*(top_left_G.
y()-top_rightG.
y()) + (top_left_G.
z()-top_rightG.
z())*(top_left_G.
z()-top_rightG.
z()) );
1016 G_width =
sqrt( (bot_left_G.
x()-top_left_G.
x())*(bot_left_G.
x()-top_left_G.
x()) + (bot_left_G.
y()-top_left_G.
y())*(bot_left_G.
y()-top_left_G.
y()) + (bot_left_G.
z()-top_left_G.
z())*(bot_left_G.
z()-top_left_G.
z()) );
1025 for (
unsigned int i =0 ;
i< v_Edge_G.size() ;
i++){
1027 if (v_Edge_G[
i].
phi() > 0. ){
1028 if (v_Edge_G[
i].
eta() < clustgp.
eta()){
1029 bot_left_G = v_Edge_G[
i];
1031 if (v_Edge_G[
i].
eta() > clustgp.
eta()){
1032 bot_rightG = v_Edge_G[
i];
1035 if (v_Edge_G[
i].
phi() < 0. ){
1036 if (v_Edge_G[
i].
eta() < clustgp.
eta()){
1037 top_left_G = v_Edge_G[
i];
1039 if (v_Edge_G[
i].
eta() > clustgp.
eta()){
1040 top_rightG = v_Edge_G[
i];
1046 G_length =
sqrt( (top_left_G.
x()-top_rightG.
x())*(top_left_G.
x()-top_rightG.
x()) + (top_left_G.
y()-top_rightG.
y())*(top_left_G.
y()-top_rightG.
y()) + (top_left_G.
z()-top_rightG.
z())*(top_left_G.
z()-top_rightG.
z()) );
1047 G_width = G_length*ratio;
1053 for (
unsigned int i = 0;
i <
m_BinEta[mylabelHisto].size() - 1;
i++){
1063 unsigned int LastBinPhi =
m_BinPhi[mylabelHisto].size() - 2;
1064 for (
unsigned int i = 0;
i <
m_BinPhi[mylabelHisto].size() - 1;
i++){
1072 bool offlimit_prev =
false;
1073 bool offlimit_foll =
false;
1075 if (phiMin <
m_BinPhi[mylabelHisto][
i]) offlimit_prev =
true;
1076 if (i != LastBinPhi){
1077 if (phiMax >
m_BinPhi[mylabelHisto][i+1]) offlimit_foll =
true;
1081 float MidPoint_X_prev;
1082 float MidPoint_Y_prev;
1083 float MidPoint_Z_prev;
1084 float MidPoint_X_foll;
1085 float MidPoint_Y_foll;
1086 float MidPoint_Z_foll;
1092 float tStar1 = (
m_BinPhi[mylabelHisto][
i]-bot_left_G.
phi())/(top_left_G.
phi()-bot_left_G.
phi());
1095 float tStar2 = (
m_BinPhi[mylabelHisto][
i]-bot_rightG.
phi())/(top_rightG.
phi()-bot_rightG.
phi());
1097 if (tStar1 < 0.) tStar1 = 0.;
1098 if (tStar2 < 0.) tStar2 = 0.;
1101 float xStar1 = bot_left_G.
x() + (tStar1*1.)*(top_left_G.
x()-bot_left_G.
x());
1102 float xStar2 = bot_rightG.
x() + (tStar2*1.)*(top_rightG.
x()-bot_rightG.
x());
1104 float yStar1 = bot_left_G.
y() + (tStar1*1.)*(top_left_G.
y()-bot_left_G.
y());
1105 float yStar2 = bot_rightG.
y() + (tStar2*1.)*(top_rightG.
y()-bot_rightG.
y());
1107 float zStar1 = bot_left_G.
z() + (tStar1*1.)*(top_left_G.
z()-bot_left_G.
z());
1108 float zStar2 = bot_rightG.
z() + (tStar2*1.)*(top_rightG.
z()-bot_rightG.
z());
1111 MidPoint_X_prev = (xStar1 + xStar2)/2.;
1112 MidPoint_Y_prev = (yStar1 + yStar2)/2.;
1113 MidPoint_Z_prev = (zStar1 + zStar2)/2.;
1116 if (offlimit_prev ==
false){
1117 MidPoint_X_prev = (bot_left_G.
x() + bot_rightG.
x())/2.;
1118 MidPoint_Y_prev = (bot_left_G.
y() + bot_rightG.
y())/2.;
1119 MidPoint_Z_prev = (bot_left_G.
z() + bot_rightG.
z())/2.;
1126 float tStar1 = (
m_BinPhi[mylabelHisto][i+1]-bot_left_G.
phi())/(top_left_G.
phi()-bot_left_G.
phi());
1129 float tStar2 = (
m_BinPhi[mylabelHisto][i+1]-bot_rightG.
phi())/(top_rightG.
phi()-bot_rightG.
phi());
1131 if (tStar1 > 1.) tStar1 = 1.;
1132 if (tStar2 > 1.) tStar2 = 1.;
1135 float xStar1 = bot_left_G.
x() + (tStar1*1.)*(top_left_G.
x()-bot_left_G.
x());
1136 float xStar2 = bot_rightG.
x() + (tStar2*1.)*(top_rightG.
x()-bot_rightG.
x());
1138 float yStar1 = bot_left_G.
y() + (tStar1*1.)*(top_left_G.
y()-bot_left_G.
y());
1139 float yStar2 = bot_rightG.
y() + (tStar2*1.)*(top_rightG.
y()-bot_rightG.
y());
1141 float zStar1 = bot_left_G.
z() + (tStar1*1.)*(top_left_G.
z()-bot_left_G.
z());
1142 float zStar2 = bot_rightG.
z() + (tStar2*1.)*(top_rightG.
z()-bot_rightG.
z());
1145 MidPoint_X_foll = (xStar1 + xStar2)/2.;
1146 MidPoint_Y_foll = (yStar1 + yStar2)/2.;
1147 MidPoint_Z_foll = (zStar1 + zStar2)/2.;
1150 if (offlimit_foll ==
false){
1151 MidPoint_X_foll = (top_left_G.
x() + top_rightG.
x())/2.;
1152 MidPoint_Y_foll = (top_left_G.
y() + top_rightG.
y())/2.;
1153 MidPoint_Z_foll = (top_left_G.
z() + top_rightG.
z())/2.;
1157 float EdgePoint_X_B = (bot_left_G.
x() + bot_rightG.
x())/2.;
1158 float EdgePoint_Y_B = (bot_left_G.
y() + bot_rightG.
y())/2.;
1159 float EdgePoint_Z_B = (bot_left_G.
z() + bot_rightG.
z())/2.;
1161 float EdgePoint_X_T = (top_left_G.
x() + top_rightG.
x())/2.;
1162 float EdgePoint_Y_T = (top_left_G.
y() + top_rightG.
y())/2.;
1163 float EdgePoint_Z_T = (top_left_G.
z() + top_rightG.
z())/2.;
1165 float G_width_Ins =
sqrt( (MidPoint_X_foll-MidPoint_X_prev)*(MidPoint_X_foll-MidPoint_X_prev) + (MidPoint_Y_foll-MidPoint_Y_prev)*(MidPoint_Y_foll-MidPoint_Y_prev) + (MidPoint_Z_foll-MidPoint_Z_prev)*(MidPoint_Z_foll-MidPoint_Z_prev) );
1171 if (i != 0 && i != LastBinPhi){
1176 if (i == 0 || i == LastBinPhi){
1177 float PhiBalance = 0.;
1178 if (clustgp.
phi() > 0.) PhiBalance = clustgp.
phi() -
M_PI ;
1179 if (clustgp.
phi() < 0.) PhiBalance = clustgp.
phi() +
M_PI ;
1184 float weight_FirstBin = (1.+ (PhiBalance/(Phi_Width/2.)))/2. ;
1185 float weight_LastBin = fabs(1. - weight_FirstBin);
1188 m_ModNormPhi[mylabelHisto][LastBinPhi] = m_ModNormPhi[mylabelHisto][LastBinPhi] + weight_LastBin*(factor*G_length*G_width);
1192 if (flag_border ==
false){
1195 if (offlimit_prev ==
false && offlimit_foll ==
false){
1200 if ((offlimit_prev ==
true && offlimit_foll ==
false)
1201 ||(offlimit_prev ==
false && offlimit_foll ==
true) ){
1202 float G_width_Out = fabs(G_width - G_width_Ins);
1208 if (offlimit_prev && i != 0)
m_ModNormPhi[mylabelHisto][i-1] =
m_ModNormPhi[mylabelHisto][i-1] + factor*G_width_Out*G_length;
1209 if (offlimit_foll && i != LastBinPhi)
m_ModNormPhi[mylabelHisto][i+1] =
m_ModNormPhi[mylabelHisto][i+1] + factor*G_width_Out*G_length;
1213 if (offlimit_prev ==
true && offlimit_foll ==
true){
1216 float G_width_T =
sqrt( (MidPoint_X_foll-EdgePoint_X_T)*(MidPoint_X_foll-EdgePoint_X_T) + (MidPoint_Y_foll-EdgePoint_Y_T)*(MidPoint_Y_foll-EdgePoint_Y_T) + (MidPoint_Z_foll-EdgePoint_Z_T)*(MidPoint_Z_foll-EdgePoint_Z_T) );
1217 float G_width_B =
sqrt( (MidPoint_X_prev-EdgePoint_X_B)*(MidPoint_X_prev-EdgePoint_X_B) + (MidPoint_Y_prev-EdgePoint_Y_B)*(MidPoint_Y_prev-EdgePoint_Y_B) + (MidPoint_Z_prev-EdgePoint_Z_B)*(MidPoint_Z_prev-EdgePoint_Z_B) );
1220 if (i != 0 && i != LastBinPhi){
1226 if (i != LastBinPhi)
m_ModNormPhi[mylabelHisto][i+1] =
m_ModNormPhi[mylabelHisto][i+1] + factor*G_width_T*G_length;
1240 TFile
output(
"MuonHLTDQMNormalization.root",
"recreate");
1253 std::vector <TH1F *> h_ModNorm_Eta;
1254 std::vector <TH1F *> h_ModNorm_Phi;
1256 for (
unsigned int p = 0;
p < v_LabelHisto.size();
p++){
1258 std::string titleHistoEta = v_LabelHisto[
p] +
"_eta" ;
1259 std::string titleHistoPhi = v_LabelHisto[
p] +
"_phi" ;
1261 std::string labelHisto = v_LabelHisto[
p];
1263 float * xbinsPhi =
new float[100];
1264 float * xbinsEta =
new float[100];
1267 unsigned int sizePhi =
m_BinPhi[labelHisto].size();
1268 for (
unsigned int i = 0;
i < sizePhi;
i++){
1272 unsigned int sizeEta =
m_BinEta[labelHisto].size();
1273 for (
unsigned int i = 0;
i < sizeEta;
i++){
1277 h_ModNorm_Eta.push_back(
new TH1F (titleHistoEta.c_str(),titleHistoEta.c_str(),sizeEta - 1,xbinsEta));
1278 h_ModNorm_Phi.push_back(
new TH1F (titleHistoPhi.c_str(),titleHistoPhi.c_str(),sizePhi - 1,xbinsPhi));
1287 (*h_ModNorm_Eta[
p]).Write();
1288 (*h_ModNorm_Phi[
p]).Write();
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
unsigned int moduleNumber(align::ID)
Module number increases (decreases) with phi for +z (-z) endcap.
T getUntrackedParameter(std::string const &, T const &) const
TkHistoMap * tkmapAllClusters
std::map< std::string, std::vector< float > > m_BinPhi
MonitorElement * EtaDistribAllClustersMap
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
unsigned int rodNumber(align::ID)
Rod number increases with phi.
edm::InputTag clusterCollectionTag_
unsigned int ringNumber(align::ID)
Ring number increases with rho.
#define DEFINE_FWK_MODULE(type)
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
Geom::Phi< T > phi() const
edm::InputTag l3collectionTag_
float GetPhiWeight(std::string label, GlobalPoint gp)
void PrintNormalization(std::vector< std::string > v_LabelHisto)
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
TkHistoMap * tkmapOnTrackClusters
MonitorElement * EtaPhiL3MuTrackClustersMap
void getSubDetLayerFolderName(std::stringstream &ss, SiStripDetId::SubDetector subDet, uint32_t layer, uint32_t side=0)
bool isNonnull() const
Checks for non-null.
MonitorElement * EtaDistribOnTrackClustersMap
float GetEtaWeight(std::string label, GlobalPoint gp)
void Normalizer(std::vector< DetId > Dets, const TrackerGeometry &theTracker)
record_type::const_iterator record_iterator
const T & max(const T &a, const T &b)
MonitorElement * EtaPhiAllClustersMap
void GeometryFromTrackGeom(std::vector< DetId > Dets, const TrackerGeometry &theTracker, std::map< std::string, std::vector< float > > &m_PhiStripMod_Eta, std::map< std::string, std::vector< float > > &m_PhiStripMod_Nb)
MonitorElement * PhiDistribAllClustersMap
bool verbose_
every n events
edm::InputTag TrackCollectionTag_
void analyzeOnTrackClusters(const reco::Track *l3tk, const TrackerGeometry &theTracker, bool isL3MuTrack=true)
SiStripMonitorMuonHLT(const edm::ParameterSet &ps)
void createMEs(const edm::EventSetup &es)
MonitorElement * EtaPhiOnTrackClustersMap
void setVerbose(unsigned level)
virtual float width() const
Width along local X.
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
int prescaleEvt_
mutriggered events
MonitorElement * EtaDistribL3MuTrackClustersMap
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::map< std::string, LayerMEs > LayerMEMap
Detector identifier class for the strip tracker.
const Bounds & bounds() const
unsigned int stringNumber(align::ID)
std::map< std::string, std::vector< float > > m_BinEta
std::map< std::string, std::vector< float > > m_ModNormPhi
virtual float widthAtHalfLength() const
T const * product() const
ClusterRegionalRef const & cluster_regional() const
int16_t FindLayer(uint32_t &detid)
virtual void beginRun(const edm::Run &run, const edm::EventSetup &es)
void getSubDetLayerSide(int &in, SiStripDetId::SubDetector &, uint32_t &layer, uint32_t &side)
unsigned int petalNumber(align::ID)
Petal number increases with phi from 1 to 8.
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
bool runOnMuonCandidates_
virtual float length() const
Lenght along local Y.
TrackingRecHitRef recHit(size_t i) const
Get i-th hit on the track.
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
std::string getLayerName(int &in)
TkHistoMap * tkmapL3MuTrackClusters
static unsigned int const shift
MonitorElement * PhiDistribOnTrackClustersMap
virtual LocalPoint localPosition(float strip) const =0
virtual SubDetector subDetector() const
Which subdetector.
virtual float length() const
std::map< std::string, std::vector< float > > m_ModNormEta
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
T const * get() const
Returns C++ pointer to the item.
void add(uint32_t &detid, float value)
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
void setCurrentFolder(const std::string &fullpath)
edm::ParameterSet parameters_
MonitorElement * PhiDistribL3MuTrackClustersMap