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 ()();
225 const SiStripRecHit1D *hit1D = dynamic_cast <
const SiStripRecHit1D * >(l3tk->
recHit (
hit).
get ());
226 const SiStripRecHit2D *hit2D = dynamic_cast <
const SiStripRecHit2D * >(l3tk->
recHit (
hit).
get ());
227 const SiStripMatchedRecHit2D *hitMatched2D = dynamic_cast <
const SiStripMatchedRecHit2D * >(l3tk->
recHit (
hit).
get ());
234 if (hit1D->cluster_regional ().isNonnull ())
236 if (hit1D->cluster_regional ().isAvailable ())
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 detID = hitMatched2D->monoCluster().geographicalId ();
335 float etaWeight = 1.;
336 float phiWeight = 1.;
342 LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
343 LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
344 LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
348 LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
349 LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
350 LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
357 detID = hitMatched2D->stereoCluster().geographicalId ();
361 if (theGeomDet2 != 0)
370 float etaWeight = 1.;
371 float phiWeight = 1.;
377 LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
378 LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
379 LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
383 LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
384 LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
385 LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
396 if (hitProj2D->originalHit ().cluster_regional ().isNonnull ())
398 if (hitProj2D->originalHit ().cluster_regional ().isAvailable ())
400 detID = hitProj2D->originalHit ().cluster_regional ()->geographicalId ();
415 float etaWeight = 1.;
416 float phiWeight = 1.;
422 LayerMEMap[label.c_str ()].EtaDistribOnTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
423 LayerMEMap[label.c_str ()].PhiDistribOnTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
424 LayerMEMap[label.c_str ()].EtaPhiOnTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
428 LayerMEMap[label.c_str ()].EtaDistribL3MuTrackClustersMap->Fill (clustgp.
eta (),etaWeight);
429 LayerMEMap[label.c_str ()].PhiDistribL3MuTrackClustersMap->Fill (clustgp.
phi (),phiWeight);
430 LayerMEMap[label.c_str ()].EtaPhiL3MuTrackClustersMap->Fill (clustgp.
eta (), clustgp.
phi ());
446 std::vector <float *> tgraphEta;
447 std::vector <float *> tgraphPhi;
448 std::vector <int> tgraphSize;
450 std::vector <std::vector<float> > binningEta;
451 std::vector <std::vector<float> > binningPhi;
453 for (
int p = 0;
p < 34;
p++){
454 tgraphEta.push_back (
new float[1000]);
455 tgraphPhi.push_back (
new float[1000]);
459 std::map< std::string,std::vector<float> > m_BinEta_Prel ;
460 std::map< std::string,std::vector<float> > m_PhiStripMod_Eta;
461 std::map< std::string,std::vector<float> > m_PhiStripMod_Nb;
471 std::vector<DetId> Dets = theTracker.
detUnitIds();
492 std::stringstream ss;
494 uint32_t subdetlayer, side;
511 std::string histoname;
515 std::string labelHisto_ID = labelHisto;
516 labelHisto_ID.erase(3);
519 unsigned int sizePhi = 0;
520 unsigned int sizeEta = 0;
521 float * xbinsPhi =
new float[100];
522 float * xbinsEta =
new float[100];
525 if (labelHisto_ID ==
"TEC" || labelHisto_ID ==
"TID" || labelHisto_ID ==
"TOB" || labelHisto_ID ==
"TIB"){
535 sizePhi =
m_BinPhi[labelHisto].size();
537 for (
unsigned int i = 0;
i < sizePhi;
i++){
542 std::vector <float > v_BinEta_Prel;
544 for (
unsigned int i = 0;
i < 12;
i++){
546 if (m_PhiStripMod_Nb[labelHisto][
i] != 0 && fabs(m_PhiStripMod_Eta[labelHisto][
i]) > 0.05){
547 float EtaBarycenter = m_PhiStripMod_Eta[labelHisto][
i]/m_PhiStripMod_Nb[labelHisto][
i];
548 v_BinEta_Prel.push_back(EtaBarycenter);
553 sort(v_BinEta_Prel.begin(),v_BinEta_Prel.end());
556 for (
unsigned int i = 0;
i < v_BinEta_Prel.size();
i++){
557 if (
i == 0)
m_BinEta[labelHisto].push_back(v_BinEta_Prel[
i] - 0.15);
559 float shift = v_BinEta_Prel[
i] - v_BinEta_Prel[
i-1];
560 m_BinEta[labelHisto].push_back(v_BinEta_Prel[
i] - shift/2.);
562 if (
i == v_BinEta_Prel.size()-1)
m_BinEta[labelHisto].push_back(v_BinEta_Prel[
i] + 0.15);
568 sizeEta =
m_BinEta[labelHisto].size();
570 for (
unsigned int i = 0;
i < sizeEta;
i++){
578 histoname =
"EtaAllClustersDistrib_" + labelHisto;
579 title =
"#eta(All Clusters) in " + labelHisto;
581 histoname =
"PhiAllClustersDistrib_" + labelHisto;
582 title =
"#phi(All Clusters) in " + labelHisto;
584 histoname =
"EtaPhiAllClustersMap_" + labelHisto;
585 title =
"#eta-#phi All Clusters map in " + labelHisto;
590 histoname =
"EtaOnTrackClustersDistrib_" + labelHisto;
591 title =
"#eta(OnTrack Clusters) in " + labelHisto;
593 histoname =
"PhiOnTrackClustersDistrib_" + labelHisto;
594 title =
"#phi(OnTrack Clusters) in " + labelHisto;
596 histoname =
"EtaPhiOnTrackClustersMap_" + labelHisto;
597 title =
"#eta-#phi OnTrack Clusters map in " + labelHisto;
602 histoname =
"EtaL3MuTrackClustersDistrib_" + labelHisto;
603 title =
"#eta(L3MuTrack Clusters) in " + labelHisto;
605 histoname =
"PhiL3MuTrackClustersDistrib_" + labelHisto;
606 title =
"#phi(L3MuTrack Clusters) in " + labelHisto;
608 histoname =
"EtaPhiL3MuTrackClustersMap_" + labelHisto;
609 title =
"#eta-#phi L3MuTrack Clusters map in " + labelHisto;
616 LayerMEMap[labelHisto].EtaDistribAllClustersMap->getTH1F()->Sumw2();
617 LayerMEMap[labelHisto].PhiDistribAllClustersMap->getTH1F()->Sumw2();
618 LayerMEMap[labelHisto].EtaPhiAllClustersMap->getTH2F()->Sumw2();
621 LayerMEMap[labelHisto].EtaDistribOnTrackClustersMap->getTH1F()->Sumw2();
622 LayerMEMap[labelHisto].PhiDistribOnTrackClustersMap->getTH1F()->Sumw2();
623 LayerMEMap[labelHisto].EtaPhiOnTrackClustersMap->getTH2F()->Sumw2();
626 LayerMEMap[labelHisto].EtaDistribL3MuTrackClustersMap->getTH1F()->Sumw2();
627 LayerMEMap[labelHisto].PhiDistribL3MuTrackClustersMap->getTH1F()->Sumw2();
628 LayerMEMap[labelHisto].EtaPhiL3MuTrackClustersMap->getTH2F()->Sumw2();
643 std::map< std::string,std::vector<float> > & m_PhiStripMod_Eta,
std::map< std::string,std::vector<float> > & m_PhiStripMod_Nb){
646 std::vector<std::string> v_LabelHisto;
650 for(std::vector<DetId>::iterator detid_iterator = Dets.begin(); detid_iterator!=Dets.end(); detid_iterator++){
651 uint32_t
detid = (*detid_iterator)();
653 if ( (*detid_iterator).null() ==
true)
break;
654 if (detid == 0)
break;
661 std::string mylabelHisto;
674 LocalPoint clustlp = topol->localPosition (1.);
686 unsigned int count = 0;
687 while (count < v_LabelHisto.size()){
688 if (mylabelHisto == v_LabelHisto[count])
break;
691 if (count == v_LabelHisto.size()){
694 v_LabelHisto.push_back(mylabelHisto);
699 for (
int i = 0;
i < 12;
i++){
700 m_PhiStripMod_Eta[mylabelHisto].push_back(0.);
701 m_PhiStripMod_Nb[mylabelHisto].push_back(0.);
722 m_PhiStripMod_Eta[mylabelHisto][
id.ringNumber()-1] = m_PhiStripMod_Eta[mylabelHisto][
id.ringNumber()-1] + clustgp.
eta();
723 m_PhiStripMod_Nb[mylabelHisto][
id.ringNumber()-1]++;
737 if (
id.isFrontRing() ==
true &&
id.isStereo() ==
false)
m_BinPhi[mylabelHisto].push_back(clustgp.
phi());
739 if (
id.isFrontRing() ==
true &&
id.isStereo() ==
true)
m_BinPhi[mylabelHisto].push_back(clustgp.
phi());
745 m_PhiStripMod_Eta[mylabelHisto][
id.ringNumber()-1] = m_PhiStripMod_Eta[mylabelHisto][
id.ringNumber()-1] + clustgp.
eta();
746 m_PhiStripMod_Nb[mylabelHisto][
id.ringNumber()-1]++;
757 if (
id.
moduleNumber() == 1 &&
id.isZMinusSide() ==
true){
759 if (
id.isStereo() ==
false)
m_BinPhi[mylabelHisto].push_back(clustgp.
phi());
764 if ( (
id.
rodNumber() == 2 &&
id.isStereo() ==
false)
765 || (
id.rodNumber() == 1 &&
id.isStereo() ==
true)
767 if (
id.isZMinusSide() ==
true){
768 m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()-1] = m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()-1] + clustgp.
eta();
769 m_PhiStripMod_Nb[mylabelHisto][
id.moduleNumber()-1]++;
771 if (
id.isZMinusSide() ==
false){
772 m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+5] = m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+5] + clustgp.
eta();
773 m_PhiStripMod_Nb[mylabelHisto][
id.moduleNumber()+5]++;
786 if (
id.
moduleNumber() == 1 &&
id.isZMinusSide() ==
true){
788 if (
id.isInternalString() ==
true &&
id.isStereo() ==
false)
m_BinPhi[mylabelHisto].push_back(clustgp.
phi());
794 || (
id.stringNumber() == 1 &&
id.isStereo() ==
true)
796 if (
id.isZMinusSide() ==
true){
797 if (
id.isInternalString() ==
true){
798 m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()-1] = m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()-1] + clustgp.
eta();
799 m_PhiStripMod_Nb[mylabelHisto][
id.moduleNumber()-1]++;
801 if (
id.isInternalString() ==
false){
802 m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+2] = m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+2] + clustgp.
eta();
803 m_PhiStripMod_Nb[mylabelHisto][
id.moduleNumber()+2]++;
806 if (
id.isZMinusSide() ==
false){
807 if (
id.isInternalString() ==
true){
808 m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+5] = m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+5] + clustgp.
eta();
809 m_PhiStripMod_Nb[mylabelHisto][
id.moduleNumber()+5]++;
811 if (
id.isInternalString() ==
false){
812 m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+8] = m_PhiStripMod_Eta[mylabelHisto][
id.moduleNumber()+8] + clustgp.
eta();
813 m_PhiStripMod_Nb[mylabelHisto][
id.moduleNumber()+8]++;
831 std::vector<std::string> v_LabelHisto;
835 for(std::vector<DetId>::iterator detid_iterator = Dets.begin(); detid_iterator!=Dets.end(); detid_iterator++){
836 uint32_t
detid = (*detid_iterator)();
838 if ( (*detid_iterator).null() ==
true)
break;
839 if (detid == 0)
break;
846 std::string mylabelHisto;
867 unsigned int count = 0;
869 while (count < v_LabelHisto.size()){
870 if (mylabelHisto == v_LabelHisto[count])
break;
874 if (count == v_LabelHisto.size()){
876 v_LabelHisto.push_back(mylabelHisto);
880 for (
unsigned int i = 0;
i <
m_BinEta[mylabelHisto].size() -1;
i++){
885 for (
unsigned int i = 0;
i <
m_BinPhi[mylabelHisto].size() -1;
i++){
906 std::string labelHisto_ID = mylabelHisto;
907 labelHisto_ID.erase(3);
912 std::vector <GlobalPoint> v_Edge_G;
918 if (labelHisto_ID ==
"TOB" || labelHisto_ID ==
"TIB"){
920 length = rectangularBound->
length();
921 width = rectangularBound->
width();
922 ratio = width/length;
933 if (labelHisto_ID ==
"TEC" || labelHisto_ID ==
"TID"){
936 length = trapezoidalBound->
length();
939 ratio = width/length;
959 std::vector <bool> v_Fill;
960 v_Fill.push_back(
false);
961 v_Fill.push_back(
false);
962 v_Fill.push_back(
false);
963 v_Fill.push_back(
false);
965 for (
unsigned int i =0 ;
i< v_Edge_G.size() ;
i++){
966 if (v_Edge_G[
i].
eta() < clustgp.
eta()){
967 if (v_Edge_G[
i].
phi() < clustgp.
phi()) {
968 bot_left_G = v_Edge_G[
i];
971 if (v_Edge_G[
i].
phi() > clustgp.
phi()){
972 top_left_G = v_Edge_G[
i];
976 if (v_Edge_G[
i].
eta() > clustgp.
eta()){
977 if (v_Edge_G[
i].
phi() < clustgp.
phi()){
978 bot_rightG = v_Edge_G[
i];
981 if (v_Edge_G[
i].
phi() > clustgp.
phi()){
982 top_rightG = v_Edge_G[
i];
993 bool flag_border =
false;
995 if (v_Fill[0] ==
true
998 && v_Fill[3] ==
true){
1001 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()) );
1004 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()) );
1013 for (
unsigned int i =0 ;
i< v_Edge_G.size() ;
i++){
1015 if (v_Edge_G[
i].
phi() > 0. ){
1016 if (v_Edge_G[
i].
eta() < clustgp.
eta()){
1017 bot_left_G = v_Edge_G[
i];
1019 if (v_Edge_G[
i].
eta() > clustgp.
eta()){
1020 bot_rightG = v_Edge_G[
i];
1023 if (v_Edge_G[
i].
phi() < 0. ){
1024 if (v_Edge_G[
i].
eta() < clustgp.
eta()){
1025 top_left_G = v_Edge_G[
i];
1027 if (v_Edge_G[
i].
eta() > clustgp.
eta()){
1028 top_rightG = v_Edge_G[
i];
1034 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()) );
1035 G_width = G_length*ratio;
1041 for (
unsigned int i = 0;
i <
m_BinEta[mylabelHisto].size() - 1;
i++){
1051 unsigned int LastBinPhi =
m_BinPhi[mylabelHisto].size() - 2;
1052 for (
unsigned int i = 0;
i <
m_BinPhi[mylabelHisto].size() - 1;
i++){
1060 bool offlimit_prev =
false;
1061 bool offlimit_foll =
false;
1063 if (phiMin <
m_BinPhi[mylabelHisto][
i]) offlimit_prev =
true;
1064 if (i != LastBinPhi){
1065 if (phiMax >
m_BinPhi[mylabelHisto][i+1]) offlimit_foll =
true;
1069 float MidPoint_X_prev;
1070 float MidPoint_Y_prev;
1071 float MidPoint_Z_prev;
1072 float MidPoint_X_foll;
1073 float MidPoint_Y_foll;
1074 float MidPoint_Z_foll;
1080 float tStar1 = (
m_BinPhi[mylabelHisto][
i]-bot_left_G.
phi())/(top_left_G.
phi()-bot_left_G.
phi());
1083 float tStar2 = (
m_BinPhi[mylabelHisto][
i]-bot_rightG.
phi())/(top_rightG.
phi()-bot_rightG.
phi());
1085 if (tStar1 < 0.) tStar1 = 0.;
1086 if (tStar2 < 0.) tStar2 = 0.;
1089 float xStar1 = bot_left_G.
x() + (tStar1*1.)*(top_left_G.
x()-bot_left_G.
x());
1090 float xStar2 = bot_rightG.
x() + (tStar2*1.)*(top_rightG.
x()-bot_rightG.
x());
1092 float yStar1 = bot_left_G.
y() + (tStar1*1.)*(top_left_G.
y()-bot_left_G.
y());
1093 float yStar2 = bot_rightG.
y() + (tStar2*1.)*(top_rightG.
y()-bot_rightG.
y());
1095 float zStar1 = bot_left_G.
z() + (tStar1*1.)*(top_left_G.
z()-bot_left_G.
z());
1096 float zStar2 = bot_rightG.
z() + (tStar2*1.)*(top_rightG.
z()-bot_rightG.
z());
1099 MidPoint_X_prev = (xStar1 + xStar2)/2.;
1100 MidPoint_Y_prev = (yStar1 + yStar2)/2.;
1101 MidPoint_Z_prev = (zStar1 + zStar2)/2.;
1104 if (offlimit_prev ==
false){
1105 MidPoint_X_prev = (bot_left_G.
x() + bot_rightG.
x())/2.;
1106 MidPoint_Y_prev = (bot_left_G.
y() + bot_rightG.
y())/2.;
1107 MidPoint_Z_prev = (bot_left_G.
z() + bot_rightG.
z())/2.;
1114 float tStar1 = (
m_BinPhi[mylabelHisto][i+1]-bot_left_G.
phi())/(top_left_G.
phi()-bot_left_G.
phi());
1117 float tStar2 = (
m_BinPhi[mylabelHisto][i+1]-bot_rightG.
phi())/(top_rightG.
phi()-bot_rightG.
phi());
1119 if (tStar1 > 1.) tStar1 = 1.;
1120 if (tStar2 > 1.) tStar2 = 1.;
1123 float xStar1 = bot_left_G.
x() + (tStar1*1.)*(top_left_G.
x()-bot_left_G.
x());
1124 float xStar2 = bot_rightG.
x() + (tStar2*1.)*(top_rightG.
x()-bot_rightG.
x());
1126 float yStar1 = bot_left_G.
y() + (tStar1*1.)*(top_left_G.
y()-bot_left_G.
y());
1127 float yStar2 = bot_rightG.
y() + (tStar2*1.)*(top_rightG.
y()-bot_rightG.
y());
1129 float zStar1 = bot_left_G.
z() + (tStar1*1.)*(top_left_G.
z()-bot_left_G.
z());
1130 float zStar2 = bot_rightG.
z() + (tStar2*1.)*(top_rightG.
z()-bot_rightG.
z());
1133 MidPoint_X_foll = (xStar1 + xStar2)/2.;
1134 MidPoint_Y_foll = (yStar1 + yStar2)/2.;
1135 MidPoint_Z_foll = (zStar1 + zStar2)/2.;
1138 if (offlimit_foll ==
false){
1139 MidPoint_X_foll = (top_left_G.
x() + top_rightG.
x())/2.;
1140 MidPoint_Y_foll = (top_left_G.
y() + top_rightG.
y())/2.;
1141 MidPoint_Z_foll = (top_left_G.
z() + top_rightG.
z())/2.;
1145 float EdgePoint_X_B = (bot_left_G.
x() + bot_rightG.
x())/2.;
1146 float EdgePoint_Y_B = (bot_left_G.
y() + bot_rightG.
y())/2.;
1147 float EdgePoint_Z_B = (bot_left_G.
z() + bot_rightG.
z())/2.;
1149 float EdgePoint_X_T = (top_left_G.
x() + top_rightG.
x())/2.;
1150 float EdgePoint_Y_T = (top_left_G.
y() + top_rightG.
y())/2.;
1151 float EdgePoint_Z_T = (top_left_G.
z() + top_rightG.
z())/2.;
1153 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) );
1159 if (i != 0 && i != LastBinPhi){
1164 if (i == 0 || i == LastBinPhi){
1165 float PhiBalance = 0.;
1166 if (clustgp.
phi() > 0.) PhiBalance = clustgp.
phi() -
M_PI ;
1167 if (clustgp.
phi() < 0.) PhiBalance = clustgp.
phi() +
M_PI ;
1172 float weight_FirstBin = (1.+ (PhiBalance/(Phi_Width/2.)))/2. ;
1173 float weight_LastBin = fabs(1. - weight_FirstBin);
1176 m_ModNormPhi[mylabelHisto][LastBinPhi] = m_ModNormPhi[mylabelHisto][LastBinPhi] + weight_LastBin*(factor*G_length*G_width);
1180 if (flag_border ==
false){
1183 if (offlimit_prev ==
false && offlimit_foll ==
false){
1188 if ((offlimit_prev ==
true && offlimit_foll ==
false)
1189 ||(offlimit_prev ==
false && offlimit_foll ==
true) ){
1190 float G_width_Out = fabs(G_width - G_width_Ins);
1196 if (offlimit_prev && i != 0)
m_ModNormPhi[mylabelHisto][i-1] =
m_ModNormPhi[mylabelHisto][i-1] + factor*G_width_Out*G_length;
1197 if (offlimit_foll && i != LastBinPhi)
m_ModNormPhi[mylabelHisto][i+1] =
m_ModNormPhi[mylabelHisto][i+1] + factor*G_width_Out*G_length;
1201 if (offlimit_prev ==
true && offlimit_foll ==
true){
1204 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) );
1205 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) );
1208 if (i != 0 && i != LastBinPhi){
1214 if (i != LastBinPhi)
m_ModNormPhi[mylabelHisto][i+1] =
m_ModNormPhi[mylabelHisto][i+1] + factor*G_width_T*G_length;
1228 TFile
output(
"MuonHLTDQMNormalization.root",
"recreate");
1241 std::vector <TH1F *> h_ModNorm_Eta;
1242 std::vector <TH1F *> h_ModNorm_Phi;
1244 for (
unsigned int p = 0;
p < v_LabelHisto.size();
p++){
1246 std::string titleHistoEta = v_LabelHisto[
p] +
"_eta" ;
1247 std::string titleHistoPhi = v_LabelHisto[
p] +
"_phi" ;
1249 std::string labelHisto = v_LabelHisto[
p];
1251 float * xbinsPhi =
new float[100];
1252 float * xbinsEta =
new float[100];
1255 unsigned int sizePhi =
m_BinPhi[labelHisto].size();
1256 for (
unsigned int i = 0;
i < sizePhi;
i++){
1260 unsigned int sizeEta =
m_BinEta[labelHisto].size();
1261 for (
unsigned int i = 0;
i < sizeEta;
i++){
1265 h_ModNorm_Eta.push_back(
new TH1F (titleHistoEta.c_str(),titleHistoEta.c_str(),sizeEta - 1,xbinsEta));
1266 h_ModNorm_Phi.push_back(
new TH1F (titleHistoPhi.c_str(),titleHistoPhi.c_str(),sizePhi - 1,xbinsPhi));
1275 (*h_ModNorm_Eta[
p]).Write();
1276 (*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)
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
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
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.
const BoundPlane & surface() const
The nominal surface of the GeomDet.
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
DetId geographicalId() 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)
void setCurrentFolder(const std::string &fullpath)
edm::ParameterSet parameters_
MonitorElement * PhiDistribL3MuTrackClustersMap