#include <CosmicHitPairGeneratorFromLayerPair.h>
Public Member Functions | |
virtual CosmicHitPairGeneratorFromLayerPair * | clone () const |
CosmicHitPairGeneratorFromLayerPair (const LayerWithHits *inner, const LayerWithHits *outer, const edm::EventSetup &iSetup) | |
virtual void | hitPairs (const TrackingRegion &ar, OrderedHitPairs &ap, const edm::Event &ev, const edm::EventSetup &iSetup) |
virtual void | hitPairs (const TrackingRegion &ar, OrderedHitPairs &ap, const edm::EventSetup &iSetup) |
const LayerWithHits * | innerLayer () const |
const LayerWithHits * | outerLayer () const |
virtual | ~CosmicHitPairGeneratorFromLayerPair () |
Private Attributes | |
const DetLayer * | innerlay |
const DetLayer * | outerlay |
const LayerWithHits * | theInnerLayer |
const LayerWithHits * | theOuterLayer |
const TrackerGeometry * | trackerGeometry |
const TransientTrackingRecHitBuilder * | TTRHbuilder |
Definition at line 40 of file CosmicHitPairGeneratorFromLayerPair.h.
CosmicHitPairGeneratorFromLayerPair::CosmicHitPairGeneratorFromLayerPair | ( | const LayerWithHits * | inner, |
const LayerWithHits * | outer, | ||
const edm::EventSetup & | iSetup | ||
) |
Definition at line 16 of file CosmicHitPairGeneratorFromLayerPair.cc.
References edm::EventSetup::get(), edm::ESHandle< T >::product(), patCandidatesForDimuonsSequences_cff::tracker, and trackerGeometry.
Referenced by clone().
: TTRHbuilder(0),trackerGeometry(0), //theLayerCache(*layerCache), theOuterLayer(outer), theInnerLayer(inner) { edm::ESHandle<TrackerGeometry> tracker; iSetup.get<TrackerDigiGeometryRecord>().get(tracker); trackerGeometry = tracker.product(); }
virtual CosmicHitPairGeneratorFromLayerPair::~CosmicHitPairGeneratorFromLayerPair | ( | ) | [inline, virtual] |
Definition at line 49 of file CosmicHitPairGeneratorFromLayerPair.h.
{ }
virtual CosmicHitPairGeneratorFromLayerPair* CosmicHitPairGeneratorFromLayerPair::clone | ( | void | ) | const [inline, virtual] |
Implements HitPairGenerator.
Definition at line 58 of file CosmicHitPairGeneratorFromLayerPair.h.
References CosmicHitPairGeneratorFromLayerPair().
{ return new CosmicHitPairGeneratorFromLayerPair(*this); }
virtual void CosmicHitPairGeneratorFromLayerPair::hitPairs | ( | const TrackingRegion & | ar, |
OrderedHitPairs & | ap, | ||
const edm::Event & | ev, | ||
const edm::EventSetup & | iSetup | ||
) | [inline, virtual] |
Implements HitPairGenerator.
Definition at line 56 of file CosmicHitPairGeneratorFromLayerPair.h.
{}
void CosmicHitPairGeneratorFromLayerPair::hitPairs | ( | const TrackingRegion & | ar, |
OrderedHitPairs & | ap, | ||
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Reimplemented from HitPairGenerator.
Definition at line 29 of file CosmicHitPairGeneratorFromLayerPair.cc.
References abs, edm::EventSetup::get(), LayerWithHits::layer(), LayerWithHits::recHits(), theInnerLayer, and theOuterLayer.
{ // static int NSee = 0; static int Ntry = 0; static int Nacc = 0; typedef OrderedHitPair::InnerRecHit InnerHit; typedef OrderedHitPair::OuterRecHit OuterHit; if (theInnerLayer->recHits().empty()) return; if (theOuterLayer->recHits().empty()) return; // const DetLayer* innerlay=theOuterLayer->layer(); // const BarrelDetLayer *pippo=dynamic_cast<const BarrelDetLayer*>(theOuterLayer->layer()); // ************ Daniele const DetLayer* blay1; const DetLayer* blay2; blay1 = dynamic_cast<const BarrelDetLayer*>(theInnerLayer->layer()); blay2 = dynamic_cast<const BarrelDetLayer*>(theOuterLayer->layer()); bool seedfromoverlaps= false; bool InTheBarrel = false; bool InTheForward = false; if (blay1 && blay2) { InTheBarrel = true; } else InTheForward = true; if (InTheBarrel){ float radius1 =dynamic_cast<const BarrelDetLayer*>(theInnerLayer->layer())->specificSurface().radius(); float radius2 =dynamic_cast<const BarrelDetLayer*>(theOuterLayer->layer())->specificSurface().radius(); seedfromoverlaps=(abs(radius1-radius2)<0.1) ? true : false; } vector<OrderedHitPair> allthepairs; std::string builderName = "WithTrackAngle"; edm::ESHandle<TransientTrackingRecHitBuilder> builder; iSetup.get<TransientRecHitRecord>().get(builderName, builder); std::vector<const TrackingRecHit*>::const_iterator ohh; for(ohh=theOuterLayer->recHits().begin();ohh!=theOuterLayer->recHits().end();ohh++){ TkHitPairsCachedHit oh= builder->build(*ohh); std::vector<const TrackingRecHit*>::const_iterator ihh; for(ihh=theInnerLayer->recHits().begin();ihh!=theInnerLayer->recHits().end();ihh++){ TkHitPairsCachedHit ih= builder->build(*ihh); float z_diff =ih->globalPosition().z()-oh->globalPosition().z(); float inny=ih->globalPosition().y(); float outy=oh->globalPosition().y(); float innx=ih->globalPosition().x(); float outx=oh->globalPosition().x();; float dxdy=abs((outx-innx)/(outy-inny)); float DeltaR=oh->globalPosition().perp()-ih->globalPosition().perp();; if( InTheBarrel && (abs(z_diff)<30) // && (outy > 0.) && (inny > 0.) //&&((abs(inny-outy))<30) &&(dxdy<2) &&(inny*outy>0) && (abs(DeltaR)>0)) { // cout << " ******** sono dentro inthebarrel *********** " << endl; if (seedfromoverlaps){ //this part of code works for MTCC // for the other geometries must be verified //Overlaps in the difference in z is decreased and the difference in phi is //less than 0.05 if ((DeltaR<0)&&(abs(z_diff)<18)&&(abs(ih->globalPosition().phi()-oh->globalPosition().phi())<0.05)&&(dxdy<2)) result.push_back( OrderedHitPair(ih, oh)); } else result.push_back( OrderedHitPair( ih, oh)); } if( InTheForward && (abs(z_diff) > 1.)) { // cout << " ******** sono dentro intheforward *********** " << endl; result.push_back( OrderedHitPair(ih,oh)); } } } // stable_sort(allthepairs.begin(),allthepairs.end(),CompareHitPairsY(iSetup)); // //Seed from overlaps are saved only if // //no others have been saved // if (allthepairs.size()>0) { // if (seedfromoverlaps) { // if (result.size()==0) result.push_back(allthepairs[0]); // } // else result.push_back(allthepairs[0]); // } }
const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::innerLayer | ( | ) | const [inline] |
Definition at line 62 of file CosmicHitPairGeneratorFromLayerPair.h.
References theInnerLayer.
{ return theInnerLayer; }
const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::outerLayer | ( | ) | const [inline] |
Definition at line 63 of file CosmicHitPairGeneratorFromLayerPair.h.
References theOuterLayer.
{ return theOuterLayer; }
const DetLayer* CosmicHitPairGeneratorFromLayerPair::innerlay [private] |
Definition at line 70 of file CosmicHitPairGeneratorFromLayerPair.h.
const DetLayer* CosmicHitPairGeneratorFromLayerPair::outerlay [private] |
Definition at line 71 of file CosmicHitPairGeneratorFromLayerPair.h.
const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::theInnerLayer [private] |
Definition at line 69 of file CosmicHitPairGeneratorFromLayerPair.h.
Referenced by hitPairs(), and innerLayer().
const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::theOuterLayer [private] |
Definition at line 68 of file CosmicHitPairGeneratorFromLayerPair.h.
Referenced by hitPairs(), and outerLayer().
const TrackerGeometry* CosmicHitPairGeneratorFromLayerPair::trackerGeometry [private] |
Definition at line 67 of file CosmicHitPairGeneratorFromLayerPair.h.
Referenced by CosmicHitPairGeneratorFromLayerPair().
Definition at line 66 of file CosmicHitPairGeneratorFromLayerPair.h.