CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TSGForOI Class Reference

Create L3MuonTrajectorySeeds from L2 Muons updated at vertex in an outside in manner. More...

#include <TSGForOI.h>

Inheritance diagram for TSGForOI:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 TSGForOI (const edm::ParameterSet &iConfig)
 
virtual ~TSGForOI ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

double calculateSFFromL2 (const GeometricSearchDet &layer, const TrajectoryStateOnSurface &tsosAtMuonSystem, const TrajectoryStateOnSurface &tsosOnLayer, const Propagator &propagatorOpposite, const reco::TrackRef track)
 Function used to calculate the dynamic error SF by analysing the L2. More...
 
void findSeedsOnLayer (const GeometricSearchDet &layer, const TrajectoryStateOnSurface &tsosAtIP, const TrajectoryStateOnSurface &tsosAtMuonSystem, const Propagator &propagatorAlong, const Propagator &propagatorOpposite, const reco::TrackRef l2, std::auto_ptr< std::vector< TrajectorySeed > > &seeds)
 Function to find seeds on a given layer. More...
 
int makeSeedsFromHits (const GeometricSearchDet &layer, const TrajectoryStateOnSurface &state, std::vector< TrajectorySeed > &out, const Propagator &propagatorAlong, const MeasurementTrackerEvent &mte, double errorSF)
 Function to find hits on layers and create seeds from updated TSOS. More...
 

Private Attributes

const bool adjustErrorsDyanmicallyForHitless_
 
const bool adjustErrorsDyanmicallyForHits_
 Whether or not to use an automatically calculated SF value. More...
 
bool analysedL2_
 
Plane::PlanePointer dummyPlane_
 Surface used to make a TSOS at the PCA to the beamline. More...
 
edm::ESHandle
< Chi2MeasurementEstimatorBase
estimator_
 
const std::string estimatorName_
 Estimator used to find dets and TrajectoryMeasurements. More...
 
const double eta1_
 
const double eta2_
 
const double fixedErrorRescalingForHitless_
 
const double fixedErrorRescalingForHits_
 How much to rescale errors from STA for fixed option. More...
 
bool foundCompatibleDet_
 Counters and flags for the implementation. More...
 
edm::ESHandle
< GlobalTrackingGeometry
geometry_
 
unsigned int layerCount_
 
edm::ESHandle< MagneticFieldmagfield_
 
const double maxEtaForTOB_
 Maximum eta value to activate searching in the TOB. More...
 
edm::Handle
< MeasurementTrackerEvent
measurementTracker_
 
const edm::EDGetTokenT
< MeasurementTrackerEvent
measurementTrackerTag_
 
const double minEtaForTEC_
 Minimum eta value to activate searching in the TEC. More...
 
const unsigned int numOfHitsToTry_
 How many hits to try on same layer. More...
 
const unsigned int numOfLayersToTry_
 How many layers to try. More...
 
unsigned int numOfMaxSeeds_
 Maximum number of seeds for each L2. More...
 
unsigned int numSeedsMade_
 
edm::ESHandle< PropagatorpropagatorAlong_
 
edm::ESHandle< PropagatorpropagatorOpposite_
 
const double pT1_
 pT, eta ranges and scale factor values More...
 
const double pT2_
 
const double pT3_
 
const double SF1_
 
const double SF2_
 
const double SF3_
 
const double SF4_
 
const double SF5_
 
const edm::EDGetTokenT
< reco::TrackCollection
src_
 Labels for input collections. More...
 
std::string theCategory
 
const double tsosDiffDeltaR_
 Difference in deltaR of TSOSs to trigger using hits in hybrid. More...
 
std::unique_ptr
< TrajectoryStateUpdator
updator_
 KFUpdator defined in constructor. More...
 
const bool useHitlessSeeds_
 Switch to use hitless seeds or not. More...
 
bool useHitsInHybrid_
 
const bool useHybridSeeds_
 Switch to use hitless + hits for seeds depending on the L2 properties. More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Create L3MuonTrajectorySeeds from L2 Muons updated at vertex in an outside in manner.

Author
Benjamin Radburn-Smith

Definition at line 34 of file TSGForOI.h.

Constructor & Destructor Documentation

TSGForOI::TSGForOI ( const edm::ParameterSet iConfig)
explicit

Definition at line 10 of file TSGForOI.cc.

References foundCompatibleDet_, edm::ParameterSet::getParameter(), numOfMaxSeeds_, numSeedsMade_, and theCategory.

10  :
11  src_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("src"))),
12  numOfLayersToTry_(iConfig.getParameter<int32_t>("layersToTry")),
13  numOfHitsToTry_(iConfig.getParameter<int32_t>("hitsToTry")),
14  fixedErrorRescalingForHits_(iConfig.getParameter<double>("fixedErrorRescaleFactorForHits")),
15  fixedErrorRescalingForHitless_(iConfig.getParameter<double>("fixedErrorRescaleFactorForHitless")),
16  adjustErrorsDyanmicallyForHits_(iConfig.getParameter<bool>("adjustErrorsDyanmicallyForHits")),
17  adjustErrorsDyanmicallyForHitless_(iConfig.getParameter<bool>("adjustErrorsDyanmicallyForHitless")),
18  estimatorName_(iConfig.getParameter<std::string>("estimator")),
19  measurementTrackerTag_(consumes<MeasurementTrackerEvent>(iConfig.getParameter<edm::InputTag>("MeasurementTrackerEvent"))),
20  minEtaForTEC_(iConfig.getParameter<double>("minEtaForTEC")),
21  maxEtaForTOB_(iConfig.getParameter<double>("maxEtaForTOB")),
22  useHitlessSeeds_(iConfig.getParameter<bool>("UseHitlessSeeds")),
23  useHybridSeeds_(iConfig.getParameter<bool>("UseHybridSeeds")),
25  updator_(new KFUpdator()),
26  pT1_(iConfig.getParameter<double>("pT1")),
27  pT2_(iConfig.getParameter<double>("pT2")),
28  pT3_(iConfig.getParameter<double>("pT3")),
29  eta1_(iConfig.getParameter<double>("eta1")),
30  eta2_(iConfig.getParameter<double>("eta2")),
31  SF1_(iConfig.getParameter<double>("SF1")),
32  SF2_(iConfig.getParameter<double>("SF2")),
33  SF3_(iConfig.getParameter<double>("SF3")),
34  SF4_(iConfig.getParameter<double>("SF4")),
35  SF5_(iConfig.getParameter<double>("SF5")),
36  tsosDiffDeltaR_(iConfig.getParameter<double>("tsosDiffDeltaR"))
37  {
38  numOfMaxSeeds_=iConfig.getParameter<uint32_t>("maxSeeds");
39  produces<std::vector<TrajectorySeed> >();
40  foundCompatibleDet_=false;
41  numSeedsMade_=0;
42  theCategory = "Muon|RecoMuon|TSGForOI";
43 }
const std::string estimatorName_
Estimator used to find dets and TrajectoryMeasurements.
Definition: TSGForOI.h:62
T getParameter(std::string const &) const
const double tsosDiffDeltaR_
Difference in deltaR of TSOSs to trigger using hits in hybrid.
Definition: TSGForOI.h:90
const bool useHitlessSeeds_
Switch to use hitless seeds or not.
Definition: TSGForOI.h:73
std::unique_ptr< TrajectoryStateUpdator > updator_
KFUpdator defined in constructor.
Definition: TSGForOI.h:82
const bool adjustErrorsDyanmicallyForHits_
Whether or not to use an automatically calculated SF value.
Definition: TSGForOI.h:58
const double SF3_
Definition: TSGForOI.h:87
const double maxEtaForTOB_
Maximum eta value to activate searching in the TOB.
Definition: TSGForOI.h:70
unsigned int numSeedsMade_
Definition: TSGForOI.h:96
const double minEtaForTEC_
Minimum eta value to activate searching in the TEC.
Definition: TSGForOI.h:67
bool foundCompatibleDet_
Counters and flags for the implementation.
Definition: TSGForOI.h:93
const double fixedErrorRescalingForHits_
How much to rescale errors from STA for fixed option.
Definition: TSGForOI.h:54
const double eta2_
Definition: TSGForOI.h:86
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
const unsigned int numOfLayersToTry_
How many layers to try.
Definition: TSGForOI.h:48
const double SF1_
Definition: TSGForOI.h:87
const double SF5_
Definition: TSGForOI.h:87
unsigned int numOfMaxSeeds_
Maximum number of seeds for each L2.
Definition: TSGForOI.h:45
const double pT1_
pT, eta ranges and scale factor values
Definition: TSGForOI.h:85
const double SF4_
Definition: TSGForOI.h:87
const double pT2_
Definition: TSGForOI.h:85
const double eta1_
Definition: TSGForOI.h:86
const double pT3_
Definition: TSGForOI.h:85
std::string theCategory
Definition: TSGForOI.h:99
const bool useHybridSeeds_
Switch to use hitless + hits for seeds depending on the L2 properties.
Definition: TSGForOI.h:76
const edm::EDGetTokenT< reco::TrackCollection > src_
Labels for input collections.
Definition: TSGForOI.h:42
Plane::PlanePointer dummyPlane_
Surface used to make a TSOS at the PCA to the beamline.
Definition: TSGForOI.h:79
const edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerTag_
Definition: TSGForOI.h:64
const double SF2_
Definition: TSGForOI.h:87
const bool adjustErrorsDyanmicallyForHitless_
Definition: TSGForOI.h:59
const unsigned int numOfHitsToTry_
How many hits to try on same layer.
Definition: TSGForOI.h:51
const double fixedErrorRescalingForHitless_
Definition: TSGForOI.h:55
TSGForOI::~TSGForOI ( )
virtual

Definition at line 46 of file TSGForOI.cc.

46  {
47 }

Member Function Documentation

double TSGForOI::calculateSFFromL2 ( const GeometricSearchDet layer,
const TrajectoryStateOnSurface tsosAtMuonSystem,
const TrajectoryStateOnSurface tsosOnLayer,
const Propagator propagatorOpposite,
const reco::TrackRef  track 
)
private

Function used to calculate the dynamic error SF by analysing the L2.

Definition at line 208 of file TSGForOI.cc.

References funct::abs(), eta1_, eta2_, pT1_, pT2_, pT3_, SF1_, SF2_, SF3_, SF4_, SF5_, and theCategory.

Referenced by findSeedsOnLayer().

212  {
213  double theSF=1.0;
214 
215 // L2 direction vs pT blowup - as was previously done:
216 // Split into 4 pT ranges: <pT1_, pT1_<pT2_, pT2_<pT3_, <pT4_: 13,30,70
217 // Split into 2 eta ranges for the middle two pT ranges: 1.0,1.4
218  if (track->pt()<=pT1_) theSF=SF1_;
219  if (track->pt()>pT1_ && track->pt()<=pT2_){
220  if (std::abs(track->eta())<=eta1_) theSF=SF3_;
221  if (std::abs(track->eta())>eta1_ && std::abs(track->eta())<=eta2_) theSF=SF2_;
222  if (std::abs(track->eta())>eta2_) theSF=SF3_;
223  }
224  if (track->pt()>pT2_ && track->pt()<=pT3_){
225  if (std::abs(track->eta())<=eta1_) theSF=SF5_;
226  if (std::abs(track->eta())>eta1_ && std::abs(track->eta())<=eta2_) theSF=SF4_;
227  if (std::abs(track->eta())>eta2_) theSF=SF5_;
228  }
229  if (track->pt()>pT3_) theSF=SF5_;
230 
231  edm::LogInfo(theCategory) << "TSGForOI::calculateSFFromL2: SF has been calculated as: " << theSF;
232  return theSF;
233 }
const double SF3_
Definition: TSGForOI.h:87
const double eta2_
Definition: TSGForOI.h:86
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const double SF1_
Definition: TSGForOI.h:87
const double SF5_
Definition: TSGForOI.h:87
const double pT1_
pT, eta ranges and scale factor values
Definition: TSGForOI.h:85
const double SF4_
Definition: TSGForOI.h:87
const double pT2_
Definition: TSGForOI.h:85
const double eta1_
Definition: TSGForOI.h:86
const double pT3_
Definition: TSGForOI.h:85
std::string theCategory
Definition: TSGForOI.h:99
const double SF2_
Definition: TSGForOI.h:87
void TSGForOI::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 283 of file TSGForOI.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), HLT_25ns10e33_v2_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

283  {
285  desc.add<edm::InputTag>("src",edm::InputTag("hltL2Muons","UpdatedAtVtx"));
286  desc.add<int>("layersToTry",1);
287  desc.add<double>("fixedErrorRescaleFactorForHitless",2.0);
288  desc.add<int>("hitsToTry",1);
289  desc.add<bool>("adjustErrorsDyanmicallyForHits",false);
290  desc.add<bool>("adjustErrorsDyanmicallyForHitless",false);
291  desc.add<edm::InputTag>("MeasurementTrackerEvent",edm::InputTag("hltSiStripClusters"));
292  desc.add<bool>("UseHitlessSeeds",true);
293  desc.add<bool>("UseHybridSeeds",false);
294  desc.add<std::string>("estimator","hltESPChi2MeasurementEstimator100");
295  desc.add<double>("maxEtaForTOB",1.2);
296  desc.add<double>("minEtaForTEC",0.8);
297  desc.addUntracked<bool>("debug",true);
298  desc.add<double>("fixedErrorRescaleFactorForHits",2.0);
299  desc.add<unsigned int>("maxSeeds",1);
300  desc.add<double>("pT1",13.0);
301  desc.add<double>("pT2",30.0);
302  desc.add<double>("pT3",70.0);
303  desc.add<double>("eta1",1.0);
304  desc.add<double>("eta2",1.4);
305  desc.add<double>("SF1",3.0);
306  desc.add<double>("SF2",4.0);
307  desc.add<double>("SF3",5.0);
308  desc.add<double>("SF4",7.0);
309  desc.add<double>("SF5",10.0);
310  desc.add<double>("tsosDiffDeltaR",0.03);
311  descriptions.add("TSGForOI",desc);
312 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void TSGForOI::findSeedsOnLayer ( const GeometricSearchDet layer,
const TrajectoryStateOnSurface tsosAtIP,
const TrajectoryStateOnSurface tsosAtMuonSystem,
const Propagator propagatorAlong,
const Propagator propagatorOpposite,
const reco::TrackRef  l2,
std::auto_ptr< std::vector< TrajectorySeed > > &  seeds 
)
private

Function to find seeds on a given layer.

Definition at line 149 of file TSGForOI.cc.

References adjustErrorsDyanmicallyForHitless_, adjustErrorsDyanmicallyForHits_, analysedL2_, calculateSFFromL2(), GeometricSearchDet::compatibleDetsV(), estimator_, fixedErrorRescalingForHitless_, fixedErrorRescalingForHits_, foundCompatibleDet_, layerCount_, makeSeedsFromHits(), measurementTracker_, numOfLayersToTry_, numOfMaxSeeds_, numSeedsMade_, oppositeToMomentum, GenerateHcalLaserBadRunList::out, trajectoryStateTransform::persistentState(), theCategory, useHitlessSeeds_, and useHybridSeeds_.

Referenced by produce().

155  {
156 
158  double errorSFHits_=1.0;
159  double errorSFHitless_=1.0;
162 
163 // Hitless:
164  std::vector< GeometricSearchDet::DetWithState > dets;
165  layer.compatibleDetsV(tsosAtIP, propagatorAlong, *estimator_, dets);
166  if (dets.size()>0){
167  auto const& detOnLayer = dets.front().first;
168  auto const& tsosOnLayer = dets.front().second;
169  // See if we need to adjust the Error Scale Factors:
171  if (!tsosOnLayer.isValid()){
172  edm::LogInfo(theCategory) << "ERROR!: TSOS for SF is not valid!";
173  }
174  else{
175  errorSFHitless_=calculateSFFromL2(layer,tsosAtMuonSystem,tsosOnLayer,propagatorOpposite,l2);
176  analysedL2_=true;
177  }
178  }
180  // Fill first seed from L2 using only state information:
181  if (!foundCompatibleDet_){
182  if (!tsosOnLayer.isValid()){
183  edm::LogInfo(theCategory) << "ERROR!: Hitless TSOS is not valid!";
184  }
185  else{
186  dets.front().second.rescaleError(errorSFHitless_);
187  PTrajectoryStateOnDet const& PTSOD = trajectoryStateTransform::persistentState(tsosOnLayer,detOnLayer->geographicalId().rawId());
189  out->push_back(TrajectorySeed(PTSOD,rHC,oppositeToMomentum));
190  foundCompatibleDet_=true;
191  }
192  }
193  numSeedsMade_=out->size();
194  }
195  }
196 
197 // Hits:
199  if (makeSeedsFromHits(layer, tsosAtIP, *out, propagatorAlong, *measurementTracker_, errorSFHits_)) {
200  ++layerCount_; //Sucessfully made seeds from hits using this layer
201  }
202  }
203  numSeedsMade_=out->size();
204  }
205 
206 }
const bool useHitlessSeeds_
Switch to use hitless seeds or not.
Definition: TSGForOI.h:73
const bool adjustErrorsDyanmicallyForHits_
Whether or not to use an automatically calculated SF value.
Definition: TSGForOI.h:58
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
unsigned int numSeedsMade_
Definition: TSGForOI.h:96
unsigned int layerCount_
Definition: TSGForOI.h:97
bool foundCompatibleDet_
Counters and flags for the implementation.
Definition: TSGForOI.h:93
const double fixedErrorRescalingForHits_
How much to rescale errors from STA for fixed option.
Definition: TSGForOI.h:54
const unsigned int numOfLayersToTry_
How many layers to try.
Definition: TSGForOI.h:48
unsigned int numOfMaxSeeds_
Maximum number of seeds for each L2.
Definition: TSGForOI.h:45
std::string theCategory
Definition: TSGForOI.h:99
const bool useHybridSeeds_
Switch to use hitless + hits for seeds depending on the L2 properties.
Definition: TSGForOI.h:76
edm::ESHandle< Chi2MeasurementEstimatorBase > estimator_
Definition: TSGForOI.h:131
bool analysedL2_
Definition: TSGForOI.h:94
double calculateSFFromL2(const GeometricSearchDet &layer, const TrajectoryStateOnSurface &tsosAtMuonSystem, const TrajectoryStateOnSurface &tsosOnLayer, const Propagator &propagatorOpposite, const reco::TrackRef track)
Function used to calculate the dynamic error SF by analysing the L2.
Definition: TSGForOI.cc:208
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
edm::Handle< MeasurementTrackerEvent > measurementTracker_
Definition: TSGForOI.h:105
const bool adjustErrorsDyanmicallyForHitless_
Definition: TSGForOI.h:59
const double fixedErrorRescalingForHitless_
Definition: TSGForOI.h:55
int makeSeedsFromHits(const GeometricSearchDet &layer, const TrajectoryStateOnSurface &state, std::vector< TrajectorySeed > &out, const Propagator &propagatorAlong, const MeasurementTrackerEvent &mte, double errorSF)
Function to find hits on layers and create seeds from updated TSOS.
Definition: TSGForOI.cc:236
int TSGForOI::makeSeedsFromHits ( const GeometricSearchDet layer,
const TrajectoryStateOnSurface state,
std::vector< TrajectorySeed > &  out,
const Propagator propagatorAlong,
const MeasurementTrackerEvent mte,
double  errorSF 
)
private

Function to find hits on layers and create seeds from updated TSOS.

Definition at line 236 of file TSGForOI.cc.

References GeometricSearchDet::compatibleDetsV(), estimator_, MeasurementDetWithData::fastMeasurements(), newFWLiteAna::found, MeasurementTrackerEvent::idToDet(), MeasurementDetWithData::isNull(), TrajectoryStateOnSurface::isValid(), eostools::move(), numOfHitsToTry_, oppositeToMomentum, trajectoryStateTransform::persistentState(), edm::OwnVector< T, P >::push_back(), fileCollector::seed, and updator_.

Referenced by findSeedsOnLayer().

241  {
242 
243  std::vector< GeometricSearchDet::DetWithState > dets;
244  layer.compatibleDetsV(tsosAtIP, propagatorAlong, *estimator_, dets);
245 
246 // Find Measurements on each DetWithState:
247  std::vector<TrajectoryMeasurement> meas;
248  for (std::vector<GeometricSearchDet::DetWithState>::iterator it=dets.begin(); it!=dets.end(); ++it) {
249  MeasurementDetWithData det = measurementTracker.idToDet(it->first->geographicalId());
250  if (det.isNull()) {
251  continue;
252  }
253  if (!it->second.isValid()) continue; //Skip if TSOS is not valid
254 
255 // Error Rescaling:
256  it->second.rescaleError(errorSF);
257 
258  std::vector < TrajectoryMeasurement > mymeas = det.fastMeasurements(it->second, tsosAtIP, propagatorAlong, *estimator_); //Second TSOS is not used
259  for (std::vector<TrajectoryMeasurement>::const_iterator it2 = mymeas.begin(), ed2 = mymeas.end(); it2 != ed2; ++it2) {
260  if (it2->recHit()->isValid()) meas.push_back(*it2); //Only save those which are valid
261  }
262  }
263 
264 // Update TSOS using TMs after sorting, then create Trajectory Seed and put into vector:
265  unsigned int found = 0;
266  std::sort(meas.begin(), meas.end(), TrajMeasLessEstim());
267  for (std::vector<TrajectoryMeasurement>::const_iterator it=meas.begin(); it!=meas.end(); ++it) {
268  TrajectoryStateOnSurface updatedTSOS = updator_->update(it->forwardPredictedState(), *it->recHit());
269  if (updatedTSOS.isValid()) {
271  seedHits.push_back(*it->recHit()->hit());
272  PTrajectoryStateOnDet const& pstate = trajectoryStateTransform::persistentState(updatedTSOS, it->recHit()->geographicalId().rawId());
273  TrajectorySeed seed(pstate, std::move(seedHits), oppositeToMomentum);
274  out.push_back(seed);
275  found++;
276  if (found == numOfHitsToTry_) break;
277  }
278  }
279  return found;
280 }
std::unique_ptr< TrajectoryStateUpdator > updator_
KFUpdator defined in constructor.
Definition: TSGForOI.h:82
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
void push_back(D *&d)
Definition: OwnVector.h:290
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &tsos2, const Propagator &prop, const MeasurementEstimator &est) const
def move
Definition: eostools.py:510
edm::ESHandle< Chi2MeasurementEstimatorBase > estimator_
Definition: TSGForOI.h:131
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
const unsigned int numOfHitsToTry_
How many hits to try on same layer.
Definition: TSGForOI.h:51
void TSGForOI::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 50 of file TSGForOI.cc.

References funct::abs(), alongMomentum, analysedL2_, deltaR(), dummyPlane_, estimator_, estimatorName_, findSeedsOnLayer(), foundCompatibleDet_, geometry_, edm::EventSetup::get(), edm::Event::getByToken(), TrajectoryStateOnSurface::globalMomentum(), trajectoryStateTransform::initialFreeState(), trajectoryStateTransform::innerFreeState(), TrajectoryStateOnSurface::isValid(), layerCount_, magfield_, maxEtaForTOB_, measurementTracker_, measurementTrackerTag_, minEtaForTEC_, numOfMaxSeeds_, numSeedsMade_, oppositeToMomentum, GenerateHcalLaserBadRunList::out, FreeTrajectoryState::position(), edm::ESHandle< class >::product(), HLT_25ns10e33_v2_cff::propagatorAlong, propagatorAlong_, HLT_25ns10e33_v2_cff::propagatorOpposite, propagatorOpposite_, edm::Event::put(), mps_fire::result, SetPropagationDirection(), src_, theCategory, tsosDiffDeltaR_, and useHybridSeeds_.

50  {
51  iSetup.get<IdealMagneticFieldRecord>().get(magfield_);
52  iSetup.get<TrackingComponentsRecord>().get("PropagatorWithMaterial", propagatorOpposite_);
53  iSetup.get<TrackingComponentsRecord>().get("PropagatorWithMaterial", propagatorAlong_);
57  edm::Handle<reco::TrackCollection> l2TrackCol; iEvent.getByToken(src_, l2TrackCol);
58 
59 // The product:
60  std::auto_ptr<std::vector<TrajectorySeed> > result(new std::vector<TrajectorySeed>());
61 
62 // Get vector of Detector layers once:
63  std::vector<BarrelDetLayer const*> const& tob = measurementTracker_->geometricSearchTracker()->tobLayers();
64  std::vector<ForwardDetLayer const*> const& tecPositive = measurementTracker_->geometricSearchTracker()->posTecLayers();
65  std::vector<ForwardDetLayer const*> const& tecNegative = measurementTracker_->geometricSearchTracker()->negTecLayers();
66 
67 // Get the suitable propagators:
70 
71  edm::ESHandle<Propagator> SmartOpposite;
72  edm::ESHandle<Propagator> SHPOpposite;
73  iSetup.get<TrackingComponentsRecord>().get("hltESPSmartPropagatorAnyOpposite", SmartOpposite);
74  iSetup.get<TrackingComponentsRecord>().get("hltESPSteppingHelixPropagatorOpposite", SHPOpposite);
75 
76 // Loop over the L2's and making seeds for all of them:
77  edm::LogInfo(theCategory) << "TSGForOI::produce: Number of L2's: " << l2TrackCol->size();
78  for (unsigned int l2TrackColIndex(0);l2TrackColIndex!=l2TrackCol->size();++l2TrackColIndex){
79  const reco::TrackRef l2(l2TrackCol, l2TrackColIndex);
80  std::auto_ptr<std::vector<TrajectorySeed> > out(new std::vector<TrajectorySeed>());
81 
83  dummyPlane_->move(fts.position() - dummyPlane_->position());
85 
87  dummyPlane_->move(notUpdatedFts.position() - dummyPlane_->position());
88  TrajectoryStateOnSurface tsosAtMuonSystem = TrajectoryStateOnSurface(notUpdatedFts, *dummyPlane_);
89 
90  if (useHybridSeeds_){
91  StateOnTrackerBound fromInside(propagatorAlong.get());
92  TrajectoryStateOnSurface outerTkStateInside = fromInside(fts);
93  StateOnTrackerBound fromOutside(&*SmartOpposite);
94  TrajectoryStateOnSurface outerTkStateOutside = fromOutside(notUpdatedFts);
95 
96  auto diffDeltaR=0.0;
97  if (outerTkStateInside.isValid() && outerTkStateOutside.isValid()){
98  diffDeltaR = deltaR(outerTkStateInside.globalMomentum(),outerTkStateOutside.globalMomentum());
99  }
100  if (diffDeltaR>tsosDiffDeltaR_){
101  // Switch on hybrid: add a hit-based seed:
102  ++numOfMaxSeeds_;
103  }
104  } //Hybrid
105 
106  numSeedsMade_=0;
107  foundCompatibleDet_=false;
108  analysedL2_ = false;
109 
110 // BARREL
111  if (std::abs(l2->eta()) < maxEtaForTOB_) {
112  layerCount_ = 0;
113  for (auto it=tob.rbegin(); it!=tob.rend(); ++it) { //This goes from outermost to innermost layer
114  findSeedsOnLayer(**it, tsosAtIP, tsosAtMuonSystem, *(propagatorAlong.get()), *(propagatorOpposite.get()), l2, out);
115  }
116  }
117 
118 // Reset Number of seeds if in overlap region:
119  if (std::abs(l2->eta())>minEtaForTEC_ && std::abs(l2->eta())<maxEtaForTOB_){
120  numSeedsMade_=0;
121  }
122 
123 // ENDCAP+
124  if (l2->eta() > minEtaForTEC_) {
125  layerCount_ = 0;
126  for (auto it=tecPositive.rbegin(); it!=tecPositive.rend(); ++it) {
127  findSeedsOnLayer(**it, tsosAtIP, tsosAtMuonSystem, *(propagatorAlong.get()), *(propagatorOpposite.get()), l2, out);
128  }
129  }
130 
131 // ENDCAP-
132  if (l2->eta() < -minEtaForTEC_) {
133  layerCount_ = 0;
134  for (auto it=tecNegative.rbegin(); it!=tecNegative.rend(); ++it) {
135  findSeedsOnLayer(**it, tsosAtIP, tsosAtMuonSystem, *(propagatorAlong.get()), *(propagatorOpposite.get()), l2, out);
136  }
137  }
138 
139  for (std::vector<TrajectorySeed>::iterator it=out->begin(); it!=out->end(); ++it){
140  result->push_back(*it);
141  }
142 
143  } //L2Collection
144  edm::LogInfo(theCategory) << "TSGForOI::produce: number of seeds made: " << result->size();
145 
146  iEvent.put(result);
147 }
const std::string estimatorName_
Estimator used to find dets and TrajectoryMeasurements.
Definition: TSGForOI.h:62
const double tsosDiffDeltaR_
Difference in deltaR of TSOSs to trigger using hits in hybrid.
Definition: TSGForOI.h:90
void findSeedsOnLayer(const GeometricSearchDet &layer, const TrajectoryStateOnSurface &tsosAtIP, const TrajectoryStateOnSurface &tsosAtMuonSystem, const Propagator &propagatorAlong, const Propagator &propagatorOpposite, const reco::TrackRef l2, std::auto_ptr< std::vector< TrajectorySeed > > &seeds)
Function to find seeds on a given layer.
Definition: TSGForOI.cc:149
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::ESHandle< Propagator > propagatorAlong_
Definition: TSGForOI.h:102
edm::ESHandle< MagneticField > magfield_
Definition: TSGForOI.h:101
const double maxEtaForTOB_
Maximum eta value to activate searching in the TOB.
Definition: TSGForOI.h:70
tuple result
Definition: mps_fire.py:84
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
unsigned int numSeedsMade_
Definition: TSGForOI.h:96
const double minEtaForTEC_
Minimum eta value to activate searching in the TEC.
Definition: TSGForOI.h:67
unsigned int layerCount_
Definition: TSGForOI.h:97
bool foundCompatibleDet_
Counters and flags for the implementation.
Definition: TSGForOI.h:93
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int numOfMaxSeeds_
Maximum number of seeds for each L2.
Definition: TSGForOI.h:45
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
GlobalPoint position() const
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
std::string theCategory
Definition: TSGForOI.h:99
const bool useHybridSeeds_
Switch to use hitless + hits for seeds depending on the L2 properties.
Definition: TSGForOI.h:76
const edm::EDGetTokenT< reco::TrackCollection > src_
Labels for input collections.
Definition: TSGForOI.h:42
edm::ESHandle< Chi2MeasurementEstimatorBase > estimator_
Definition: TSGForOI.h:131
bool analysedL2_
Definition: TSGForOI.h:94
Plane::PlanePointer dummyPlane_
Surface used to make a TSOS at the PCA to the beamline.
Definition: TSGForOI.h:79
edm::ESHandle< Propagator > propagatorOpposite_
Definition: TSGForOI.h:103
GlobalVector globalMomentum() const
const edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerTag_
Definition: TSGForOI.h:64
FreeTrajectoryState innerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
edm::ESHandle< GlobalTrackingGeometry > geometry_
Definition: TSGForOI.h:104
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
edm::Handle< MeasurementTrackerEvent > measurementTracker_
Definition: TSGForOI.h:105

Member Data Documentation

const bool TSGForOI::adjustErrorsDyanmicallyForHitless_
private

Definition at line 59 of file TSGForOI.h.

Referenced by findSeedsOnLayer().

const bool TSGForOI::adjustErrorsDyanmicallyForHits_
private

Whether or not to use an automatically calculated SF value.

Definition at line 58 of file TSGForOI.h.

Referenced by findSeedsOnLayer().

bool TSGForOI::analysedL2_
private

Definition at line 94 of file TSGForOI.h.

Referenced by findSeedsOnLayer(), and produce().

Plane::PlanePointer TSGForOI::dummyPlane_
private

Surface used to make a TSOS at the PCA to the beamline.

Definition at line 79 of file TSGForOI.h.

Referenced by produce().

edm::ESHandle<Chi2MeasurementEstimatorBase> TSGForOI::estimator_
private

Definition at line 131 of file TSGForOI.h.

Referenced by findSeedsOnLayer(), makeSeedsFromHits(), and produce().

const std::string TSGForOI::estimatorName_
private

Estimator used to find dets and TrajectoryMeasurements.

Definition at line 62 of file TSGForOI.h.

Referenced by produce().

const double TSGForOI::eta1_
private

Definition at line 86 of file TSGForOI.h.

Referenced by calculateSFFromL2().

const double TSGForOI::eta2_
private

Definition at line 86 of file TSGForOI.h.

Referenced by calculateSFFromL2().

const double TSGForOI::fixedErrorRescalingForHitless_
private

Definition at line 55 of file TSGForOI.h.

Referenced by findSeedsOnLayer().

const double TSGForOI::fixedErrorRescalingForHits_
private

How much to rescale errors from STA for fixed option.

Definition at line 54 of file TSGForOI.h.

Referenced by findSeedsOnLayer().

bool TSGForOI::foundCompatibleDet_
private

Counters and flags for the implementation.

Definition at line 93 of file TSGForOI.h.

Referenced by findSeedsOnLayer(), produce(), and TSGForOI().

edm::ESHandle<GlobalTrackingGeometry> TSGForOI::geometry_
private

Definition at line 104 of file TSGForOI.h.

Referenced by produce().

unsigned int TSGForOI::layerCount_
private

Definition at line 97 of file TSGForOI.h.

Referenced by findSeedsOnLayer(), and produce().

edm::ESHandle<MagneticField> TSGForOI::magfield_
private

Definition at line 101 of file TSGForOI.h.

Referenced by produce().

const double TSGForOI::maxEtaForTOB_
private

Maximum eta value to activate searching in the TOB.

Definition at line 70 of file TSGForOI.h.

Referenced by produce().

edm::Handle<MeasurementTrackerEvent> TSGForOI::measurementTracker_
private

Definition at line 105 of file TSGForOI.h.

Referenced by findSeedsOnLayer(), and produce().

const edm::EDGetTokenT<MeasurementTrackerEvent> TSGForOI::measurementTrackerTag_
private

Definition at line 64 of file TSGForOI.h.

Referenced by produce().

const double TSGForOI::minEtaForTEC_
private

Minimum eta value to activate searching in the TEC.

Definition at line 67 of file TSGForOI.h.

Referenced by produce().

const unsigned int TSGForOI::numOfHitsToTry_
private

How many hits to try on same layer.

Definition at line 51 of file TSGForOI.h.

Referenced by makeSeedsFromHits().

const unsigned int TSGForOI::numOfLayersToTry_
private

How many layers to try.

Definition at line 48 of file TSGForOI.h.

Referenced by findSeedsOnLayer().

unsigned int TSGForOI::numOfMaxSeeds_
private

Maximum number of seeds for each L2.

Definition at line 45 of file TSGForOI.h.

Referenced by findSeedsOnLayer(), produce(), and TSGForOI().

unsigned int TSGForOI::numSeedsMade_
private

Definition at line 96 of file TSGForOI.h.

Referenced by findSeedsOnLayer(), produce(), and TSGForOI().

edm::ESHandle<Propagator> TSGForOI::propagatorAlong_
private

Definition at line 102 of file TSGForOI.h.

Referenced by produce().

edm::ESHandle<Propagator> TSGForOI::propagatorOpposite_
private

Definition at line 103 of file TSGForOI.h.

Referenced by produce().

const double TSGForOI::pT1_
private

pT, eta ranges and scale factor values

Definition at line 85 of file TSGForOI.h.

Referenced by calculateSFFromL2().

const double TSGForOI::pT2_
private

Definition at line 85 of file TSGForOI.h.

Referenced by calculateSFFromL2().

const double TSGForOI::pT3_
private

Definition at line 85 of file TSGForOI.h.

Referenced by calculateSFFromL2().

const double TSGForOI::SF1_
private

Definition at line 87 of file TSGForOI.h.

Referenced by calculateSFFromL2().

const double TSGForOI::SF2_
private

Definition at line 87 of file TSGForOI.h.

Referenced by calculateSFFromL2().

const double TSGForOI::SF3_
private

Definition at line 87 of file TSGForOI.h.

Referenced by calculateSFFromL2().

const double TSGForOI::SF4_
private

Definition at line 87 of file TSGForOI.h.

Referenced by calculateSFFromL2().

const double TSGForOI::SF5_
private

Definition at line 87 of file TSGForOI.h.

Referenced by calculateSFFromL2().

const edm::EDGetTokenT<reco::TrackCollection> TSGForOI::src_
private

Labels for input collections.

Definition at line 42 of file TSGForOI.h.

Referenced by produce().

std::string TSGForOI::theCategory
private

Definition at line 99 of file TSGForOI.h.

Referenced by calculateSFFromL2(), findSeedsOnLayer(), produce(), and TSGForOI().

const double TSGForOI::tsosDiffDeltaR_
private

Difference in deltaR of TSOSs to trigger using hits in hybrid.

Definition at line 90 of file TSGForOI.h.

Referenced by produce().

std::unique_ptr<TrajectoryStateUpdator> TSGForOI::updator_
private

KFUpdator defined in constructor.

Definition at line 82 of file TSGForOI.h.

Referenced by makeSeedsFromHits().

const bool TSGForOI::useHitlessSeeds_
private

Switch to use hitless seeds or not.

Definition at line 73 of file TSGForOI.h.

Referenced by findSeedsOnLayer().

bool TSGForOI::useHitsInHybrid_
private

Definition at line 95 of file TSGForOI.h.

const bool TSGForOI::useHybridSeeds_
private

Switch to use hitless + hits for seeds depending on the L2 properties.

Definition at line 76 of file TSGForOI.h.

Referenced by findSeedsOnLayer(), and produce().