53 :
public std::binary_function< const SiStripRecHit2D*,const SiStripRecHit2D*,bool> {
58 bool operator()(
const SiStripRecHit2D*
a,
const SiStripRecHit2D*
b)
const {
59 return *(a->cluster())<*(b->cluster());
85 std::vector<uint32_t> activeDets;
90 tkmechstruct->addActiveDetectorsRawIds(activeDets);
94 TrackerGeometry::DetIdContainer::const_iterator Iditer;
96 for(Iditer=Id.begin();Iditer!=Id.end();Iditer++){
97 activeDets.push_back(Iditer->rawId());
115 Hit_Tree = hFile->mkdir(
"Hit_Tree");
119 HitsTree =
new TTree(
"HitsTree",
"HitsTree");
155 TrackTree =
new TTree(
"TrackTree",
"TrackTree");
161 EventTree =
new TTree(
"EventTree",
"EventTree");
178 for(std::vector<uint32_t>::const_iterator Id = activeDets.begin(); Id!=activeDets.end(); Id++){
182 DetId *Iditer=&Iditero;
187 module_bin = TIB_bin;
189 module_bin = TOB_bin;
198 if(stripdet==0)
continue;
220 unsigned int layerid;
222 name+=TkTag.
label().c_str();
227 summaryprofile=
dbe_->
bookProfile(name,name,SUM_bin,TIBRangeMin,TIBRangeMax,20,0,5,
"");
229 summaryprofile=
dbe_->
bookProfile(name,name,SUM_bin,TOBRangeMin,TOBRangeMax,20,0,5,
"");
234 summaryparam->
thickness = thickness*10000;
260 detparmap::iterator detpariter;
261 for( detpariter=
detmap.begin(); detpariter!=
detmap.end();++detpariter)
delete detpariter->second;
294 std::map<const SiStripRecHit2D*,std::pair<float,float>,DetIdLess> hitangleassociation;
295 std::list<SiStripRecHit2D> cache;
298 trajsize=TrajectoryCollection->size();
301 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = "<<
trajsize<<
"\n";
305 for(TrajTrackIter = TrajTrackMap->begin(); TrajTrackIter!= TrajTrackMap->end(); TrajTrackIter++){
307 if(TrajTrackIter->
key->foundHits()>=5){
320 pt = TrajTrackIter->
val->pt();
327 std::vector<TrajectoryMeasurement> TMeas=TrajTrackIter->
key->measurements();
328 std::vector<TrajectoryMeasurement>::iterator itm;
330 for (itm=TMeas.begin();itm!=TMeas.end();itm++){
361 const SiStripMatchedRecHit2D* matchedhit=
dynamic_cast<const SiStripMatchedRecHit2D*
>((*thit).hit());
363 const SiStripRecHit2D*
hit=
dynamic_cast<const SiStripRecHit2D*
>((*thit).hit());
377 cache.push_back(matchedhit->monoHit());
378 const SiStripRecHit2D * monohit = &cache.back();
379 const SiStripRecHit2D::ClusterRef & monocluster=monohit->cluster();
382 const LocalPoint monoposition = monohit->localPosition();
392 const std::vector<uint8_t> amplitudes = monocluster->amplitudes();
395 uint16_t FirstStrip = monocluster->firstStrip();
396 std::vector<uint8_t>::const_iterator idigi;
397 std::vector<uint8_t>::const_iterator
begin=amplitudes.begin();
399 for(idigi=begin; idigi!=amplitudes.end(); idigi++){
439 if(monotkdir.
z()!=0){
442 float tanangle = monotkdir.
x()/monotkdir.
z();
445 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
447 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
451 float signcorrection = (localmagdir * monoylocal)/(
MagField);
455 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(monohit);
458 if(alreadystored != hitangleassociation.end()){
459 if(itm->estimate() > alreadystored->second.first){
461 if(itm->estimate() < alreadystored->second.first){
463 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
467 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
474 cache.push_back(matchedhit->stereoHit());
475 const SiStripRecHit2D * stereohit = &cache.back();
476 const SiStripRecHit2D::ClusterRef & stereocluster=stereohit->cluster();
479 const LocalPoint stereoposition = stereohit->localPosition();
487 ClSize = (stereocluster->amplitudes()).
size();
489 const std::vector<uint8_t> amplitudes = stereocluster->amplitudes();
491 barycenter = stereocluster->barycenter()- 0.5;
492 uint16_t FirstStrip = stereocluster->firstStrip();
493 std::vector<uint8_t>::const_iterator idigi;
494 std::vector<uint8_t>::const_iterator begin=amplitudes.begin();
496 for(idigi=begin; idigi!=amplitudes.end(); idigi++){
535 if(stereotkdir.
z()!=0){
538 float tanangle = stereotkdir.
x()/stereotkdir.
z();
541 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
543 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
547 float signcorrection = (localmagdir * stereoylocal)/(
MagField);
550 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(stereohit);
552 if(alreadystored != hitangleassociation.end()){
553 if(itm->estimate() > alreadystored->second.first){
555 if(itm->estimate() < alreadystored->second.first){
557 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
561 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
573 const SiStripRecHit2D::ClusterRef & cluster=hit->cluster();
586 const std::vector<uint8_t> amplitudes = cluster->amplitudes();
589 uint16_t FirstStrip = cluster->firstStrip();
590 std::vector<uint8_t>::const_iterator idigi;
591 std::vector<uint8_t>::const_iterator
begin=amplitudes.begin();
593 for(idigi=begin; idigi!=amplitudes.end(); idigi++){
629 if(trackdirection.
z()!=0){
632 float tanangle = trackdirection.
x()/trackdirection.
z();
635 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
637 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
641 float signcorrection = (localmagdir * ylocal)/(
MagField);
644 std::map<const SiStripRecHit2D *,std::pair<float,float>, DetIdLess>::iterator alreadystored=hitangleassociation.find(hit);
646 if(alreadystored != hitangleassociation.end()){
647 if(itm->estimate() > alreadystored->second.first){
649 if(itm->estimate() < alreadystored->second.first){
651 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(),tanangle)));
655 hitangleassociation.insert(std::make_pair(hit,std::make_pair(itm->estimate(), tanangle) ) );
666 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator hitsiter;
669 for(hitsiter=hitangleassociation.begin();hitsiter!=hitangleassociation.end();hitsiter++){
673 const SiStripRecHit2D*
hit=hitsiter->first;
674 const SiStripRecHit2D::ClusterRef & cluster=hit->cluster();
676 size=(cluster->amplitudes()).
size();
680 float tangent = hitsiter->second.second;
684 detparmap::iterator thedet=
detmap.find(detid.
rawId());
686 if(thedet!=
detmap.end())localmagdir=thedet->second->magfield;
687 float localmagfield = localmagdir.
mag();
689 if(localmagfield != 0.){
693 float normprojection = (localmagdir * ylocal)/(localmagfield);
695 if(normprojection == 0.)
LogDebug(
"SiStripLAProfileBooker::analyze")<<
"Error: YBprojection = 0";
698 float signprojcorrection = 1/normprojection;
699 tangent*=signprojcorrection;
705 histomap::iterator thehisto=
histos.find(detid.
rawId());
707 if(thehisto==
histos.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to"<<detid.
rawId()<<
"does not exist! ";
708 else thehisto->second->Fill(tangent,
size);
712 unsigned int layerid;
714 histomap::iterator thesummaryhisto=
summaryhisto.find(layerid);
715 if(thesummaryhisto==
summaryhisto.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to subdet "<<name<<
"does not exist! ";
716 else thesummaryhisto->second->Fill(tangent,
size);
728 std::stringstream layernum;
733 layer = TIBid.
layer();
739 layer = TIDid.
ring();
745 layer = TOBid.
layer();
752 layer = TECid.
ring();
755 name+=layernum.str();
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int layer() const
layer id
const GeomDetUnit * monoDet() const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
LocalVector localDirection() const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
std::vector< Track > TrackCollection
collection of Tracks
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
~SiStripLAProfileBooker()
std::vector< unsigned int > string() const
string id
static int position[TOTALCHAMBERS][3]
const BoundPlane & specificSurface() const
Same as surface(), kept for backward compatibility.
std::vector< unsigned int > rod() const
rod id
uint32_t rawId() const
get the raw id
virtual float thickness() const =0
virtual const Topology & topology() const =0
virtual float localPitch(const LocalPoint &) const =0
std::vector< unsigned int > petal() const
petal id
void beginRun(const edm::EventSetup &c)
unsigned int ring() const
ring id
std::vector< unsigned int > module() const
det id
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
void setDetectorFolder(uint32_t rawdetid=0)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void analyze(const edm::Event &e, const edm::EventSetup &c)
unsigned int stereo() const
stereo
const Bounds & bounds() const
std::string createHistoId(std::string description, std::string id_type, uint32_t component_id)
bool operator()(const SiStripRecHit2D *a, const SiStripRecHit2D *b) const
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
std::vector< Trajectory > TrajectoryCollection
const BoundPlane & surface() const
The nominal surface of the GeomDet.
float TanTrackAngleParallel
unsigned int ring() const
ring id
SiStripLAProfileBooker(const edm::ParameterSet &conf)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
const SiStripRecHit2D & originalHit() const
Power< A, B >::type pow(const A &a, const B &b)
const GeomDetUnit * stereoDet() const
unsigned int wheel() const
wheel id
std::vector< DetId > DetIdContainer
const TrackerGeometry * tracker
void getlayer(const DetId &detid, std::string &name, unsigned int &layerid)