ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/L1RpcTriggerAnalysis/plugins/LinkSynchroAnalysis.cc
(Generate patch)

Comparing UserCode/L1RpcTriggerAnalysis/plugins/LinkSynchroAnalysis.cc (file contents):
Revision 1.1 by konec, Tue May 18 10:52:22 2010 UTC vs.
Revision 1.2 by konec, Wed May 26 06:26:44 2010 UTC

# Line 18 | Line 18
18   #include "TH1F.h"
19   #include <map>
20  
21 + #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
22 + #include "DataFormats/GeometryVector/interface/GlobalVector.h"
23 +
24 + struct LessGP { bool operator () (const GlobalPoint & p1, const GlobalPoint & p2) const { return p1.perp() < p2.perp(); } };
25 +
26   LinkSynchroAnalysis::LinkSynchroAnalysis(const edm::ParameterSet& cfg)
27      : RPCMonitorLinkSynchro(cfg.getParameter<edm::ParameterSet>("linkMonitorPSet")), theAnaConfig(cfg),theCabling(0), theEventCounter(0) { }
28  
# Line 32 | Line 37 | void LinkSynchroAnalysis::beginJob()
37    theHistos.Add(new TH1F("hDeltaEta","hDeltaEta",100, 0., 1.));
38    theHistos.Add(new TH1F("hDxy","hDxy",100.,0.,1.));
39    theHistos.Add(new TH1F("hNumTracks","hNumTracks",50,0.,250.));
40 +  theHistos.Add(new TH1F("hDistB","hDistB",50,0.,200.));
41 +  theHistos.Add(new TH1F("hDistE","hDistE",50,0.,500.));
42 +  theHistos.Add(new TH1F("hPenetrationB","hPenetrationB",10,0.,10.));
43 +  theHistos.Add(new TH1F("hPenetrationE","hPenetrationE",10,0.,10.));
44  
45    typedef std::vector<edm::ParameterSet> VPSet;
46    VPSet selectorConfigs = theAnaConfig.getParameter<VPSet>("ORedSynchroFilters");
# Line 77 | Line 86 | const RPCRawSynchro::ProdItem& LinkSynch
86      LogTrace("") << "LinkSynchroAnalysis - record has CHANGED!!, read map, VERSION: " << theCabling->version();
87    }
88  
89 +  theSynchroFilters[0].resetPos();
90    for(RPCRawSynchro::ProdItem::const_iterator it = vItem.begin(); it != vItem.end(); ++it) {
91      const LinkBoardElectronicIndex & path = it->first;
92      const  std::vector<FebConnectorSpec> & febs = theCabling->location(path)->febs();
# Line 91 | Line 101 | const RPCRawSynchro::ProdItem& LinkSynch
101      if (takeIt) selected.push_back(*it);
102      if (takeIt) wasTakeIt = true;
103    }
104 +  std::vector<GlobalPoint> pos = theSynchroFilters[0].positions();
105 + std::sort(pos.begin(), pos.end(), LessGP());
106 +  GlobalPoint last(0.,0.,0.);
107 +  unsigned int points = 0;
108 +  bool barrel = false;
109 +  bool endcap = false;
110 +  for (std::vector<GlobalPoint>::const_iterator ip= pos.begin(); ip != pos.end(); ++ip) {
111 +    double dist = 0.;
112 +    if (fabs(ip->eta()) > 1.24 && fabs(ip->eta()) < 1.6 ) endcap = true;
113 +    if (fabs(ip->eta()) < 0.93)  barrel= true;
114 +    if (barrel) dist = ((*ip)-last).perp();
115 +    if (endcap) dist = fabs(((*ip)-last).z());
116 +    if (barrel) static_cast<TH1F* >(theHistos.FindObject("hDistB"))->Fill(dist);
117 +    if (endcap) static_cast<TH1F* >(theHistos.FindObject("hDistE"))->Fill(dist);
118 +    if (endcap&& dist > 50.) points++;
119 +    if (barrel&& dist > 30.) points++;
120 +    last = *ip;
121 +    std::cout <<"HERE,  barrel: " <<barrel<<" endcap:"<< endcap<<" dist: " << dist <<" points: "<<points<< *ip<<std::endl;
122 +  }
123 +  std::cout <<"POINTS: " << points << std::endl;
124 +  if (barrel && endcap) std::cout << "PROBLEM" << std::endl;
125 +  if (wasTakeIt && barrel ) static_cast<TH1F* >(theHistos.FindObject("hPenetrationB"))->Fill(points);
126 +  if (wasTakeIt && endcap) static_cast<TH1F* >(theHistos.FindObject("hPenetrationE"))->Fill(points);
127    if (wasTakeIt) static_cast<TH1*>(theHistos.FindObject("hBX"))->Fill( ev.bunchCrossing());
128    if (wasTakeIt) theEventCounter++;
129    return selected;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines