51 :
public std::binary_function< const SiStripRecHit2D*,const SiStripRecHit2D*,bool> {
87 std::vector<uint32_t> activeDets;
96 TrackerGeometry::DetIdContainer::const_iterator Iditer;
98 for(Iditer=Id.begin();Iditer!=Id.end();Iditer++){
99 activeDets.push_back(Iditer->rawId());
117 Hit_Tree = hFile->mkdir(
"Hit_Tree");
121 HitsTree =
new TTree(
"HitsTree",
"HitsTree");
157 TrackTree =
new TTree(
"TrackTree",
"TrackTree");
163 EventTree =
new TTree(
"EventTree",
"EventTree");
180 for(std::vector<uint32_t>::const_iterator Id = activeDets.begin(); Id!=activeDets.end(); Id++){
184 DetId *Iditer=&Iditero;
189 module_bin = TIB_bin;
191 module_bin = TOB_bin;
200 if(!stripdet->isLeaf())
continue;
202 float thickness=stripdet->specificSurface().bounds().thickness();
213 const GlobalPoint globalp = (stripdet->surface()).toGlobal(p);
222 unsigned int layerid;
224 name+=TkTag.
label().c_str();
229 summaryprofile=
dbe_->
bookProfile(name,name,SUM_bin,TIBRangeMin,TIBRangeMax,20,0,5,
"");
231 summaryprofile=
dbe_->
bookProfile(name,name,SUM_bin,TOBRangeMin,TOBRangeMax,20,0,5,
"");
236 summaryparam->
thickness = thickness*10000;
262 detparmap::iterator detpariter;
263 for( detpariter=
detmap.begin(); detpariter!=
detmap.end();++detpariter)
delete detpariter->second;
300 std::map<const SiStripRecHit2D*,std::pair<float,float>,DetIdLess> hitangleassociation;
301 std::list<SiStripRecHit2D>
cache;
304 trajsize=TrajectoryCollection->size();
307 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = "<<
trajsize<<
"\n";
311 for(TrajTrackIter = TrajTrackMap->
begin(); TrajTrackIter!= TrajTrackMap->
end(); TrajTrackIter++){
313 if(TrajTrackIter->key->foundHits()>=5){
326 pt = TrajTrackIter->val->pt();
328 chi2norm = TrajTrackIter->val->normalizedChi2();
329 EtaTrack = TrajTrackIter->val->eta();
330 PhiTrack = TrajTrackIter->val->phi();
333 std::vector<TrajectoryMeasurement> TMeas=TrajTrackIter->key->measurements();
334 std::vector<TrajectoryMeasurement>::iterator itm;
336 for (itm=TMeas.begin();itm!=TMeas.end();itm++){
371 if(phit) {lhit = phit->
originalHit(); hit = &lhit;}
384 cache.push_back(matchedhit->
monoHit());
399 const auto & amplitudes = monocluster->amplitudes();
402 uint16_t FirstStrip = monocluster->firstStrip();
403 auto begin=amplitudes.begin();
405 for(
auto idigi=
begin; idigi!=amplitudes.end(); idigi++){
445 if(monotkdir.
z()!=0){
448 float tanangle = monotkdir.
x()/monotkdir.
z();
451 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
453 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
457 float signcorrection = (localmagdir * monoylocal)/(
MagField);
461 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(monohit);
464 if(alreadystored != hitangleassociation.end()){
465 if(itm->estimate() > alreadystored->second.first){
467 if(itm->estimate() < alreadystored->second.first){
469 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
473 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
480 cache.push_back(matchedhit->
stereoHit());
493 ClSize = (stereocluster->amplitudes()).
size();
495 const auto & amplitudes = stereocluster->amplitudes();
497 barycenter = stereocluster->barycenter()- 0.5;
498 uint16_t FirstStrip = stereocluster->firstStrip();
499 auto begin=amplitudes.begin();
501 for(
auto idigi=
begin; idigi!=amplitudes.end(); idigi++){
540 if(stereotkdir.
z()!=0){
543 float tanangle = stereotkdir.
x()/stereotkdir.
z();
546 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
548 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
552 float signcorrection = (localmagdir * stereoylocal)/(
MagField);
555 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(stereohit);
557 if(alreadystored != hitangleassociation.end()){
558 if(itm->estimate() > alreadystored->second.first){
560 if(itm->estimate() < alreadystored->second.first){
562 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
566 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
591 const auto & amplitudes = cluster->amplitudes();
594 uint16_t FirstStrip = cluster->firstStrip();
596 auto begin =amplitudes.begin();
597 for(
auto idigi=amplitudes.begin(); idigi!=amplitudes.end(); idigi++){
633 if(trackdirection.
z()!=0){
636 float tanangle = trackdirection.
x()/trackdirection.
z();
639 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
641 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
645 float signcorrection = (localmagdir * ylocal)/(
MagField);
648 std::map<const SiStripRecHit2D *,std::pair<float,float>, DetIdLess>::iterator alreadystored=hitangleassociation.find(hit);
650 if(alreadystored != hitangleassociation.end()){
651 if(itm->estimate() > alreadystored->second.first){
653 if(itm->estimate() < alreadystored->second.first){
655 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(),tanangle)));
659 hitangleassociation.insert(std::make_pair(hit,std::make_pair(itm->estimate(), tanangle) ) );
670 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator hitsiter;
673 for(hitsiter=hitangleassociation.begin();hitsiter!=hitangleassociation.end();hitsiter++){
680 size=(cluster->amplitudes()).
size();
684 float tangent = hitsiter->second.second;
688 detparmap::iterator thedet=
detmap.find(detid.
rawId());
690 if(thedet!=
detmap.end())localmagdir=thedet->second->magfield;
691 float localmagfield = localmagdir.
mag();
693 if(localmagfield != 0.){
697 float normprojection = (localmagdir * ylocal)/(localmagfield);
699 if(normprojection == 0.)
LogDebug(
"SiStripLAProfileBooker::analyze")<<
"Error: YBprojection = 0";
702 float signprojcorrection = 1/normprojection;
703 tangent*=signprojcorrection;
709 histomap::iterator thehisto=
histos.find(detid.
rawId());
711 if(thehisto==
histos.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to"<<detid.
rawId()<<
"does not exist! ";
712 else thehisto->second->Fill(tangent,
size);
716 unsigned int layerid;
718 histomap::iterator thesummaryhisto=
summaryhisto.find(layerid);
719 if(thesummaryhisto==
summaryhisto.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to subdet "<<name<<
"does not exist! ";
720 else thesummaryhisto->second->Fill(tangent,
size);
732 std::stringstream layernum;
759 name+=layernum.str();
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
const GeomDetUnit * monoDet() const
friend struct const_iterator
const_iterator end() const
last iterator over the map (read only)
virtual const Topology & topology() const
std::vector< unsigned int > tidModuleInfo(const DetId &id) const
LocalVector localDirection() const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
unsigned int tecRing(const DetId &id) const
ring id
std::vector< Track > TrackCollection
collection of Tracks
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
const Bounds & bounds() const
unsigned int tidWheel(const DetId &id) const
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
~SiStripLAProfileBooker()
std::vector< unsigned int > tibStringInfo(const DetId &id) const
const Plane & surface() const
The nominal surface of the GeomDet.
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
uint32_t rawId() const
get the raw id
std::vector< unsigned int > tecPetalInfo(const DetId &id) const
void beginRun(edm::Run const &, const edm::EventSetup &c)
std::vector< unsigned int > tobRodInfo(const DetId &id) const
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
void getlayer(const DetId &detid, const TrackerTopology *tTopo, std::string &name, unsigned int &layerid)
ClusterRef cluster() const
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
virtual LocalPoint localPosition() const final
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
void analyze(const edm::Event &e, const edm::EventSetup &c)
SiStripRecHit2D originalHit() const
unsigned int stereo() const
stereo
SiStripRecHit2D stereoHit() const
virtual float thickness() const =0
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
bool operator()(const SiStripRecHit2D *a, const SiStripRecHit2D *b) const
virtual float localPitch(const LocalPoint &) const =0
std::vector< Trajectory > TrajectoryCollection
SiStripRecHit2D monoHit() const
float TanTrackAngleParallel
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
static int position[264][3]
const_iterator begin() const
first iterator over the map (read only)
DetId geographicalId() const
SiStripLAProfileBooker(const edm::ParameterSet &conf)
unsigned int tecWheel(const DetId &id) const
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
Power< A, B >::type pow(const A &a, const B &b)
const GeomDetUnit * stereoDet() const
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
unsigned int tobLayer(const DetId &id) const
const TrackerGeomDet * idToDet(DetId) const
std::vector< DetId > DetIdContainer
const TrackerGeometry * tracker