Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:30

0001 #ifndef _TrackerReco_MultiTrajectoryStateAssembler_h_
0002 #define _TrackerReco_MultiTrajectoryStateAssembler_h_
0003 
0004 // #include "Utilities/Notification/interface/TimingReport.h"
0005 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0006 #include <vector>
0007 // #include <map>
0008 
0009 /** \class MultiTrajectoryStateAssembler
0010  * Collects trajectory states and returns a MultiTrajectoryState.
0011  */
0012 
0013 class MultiTrajectoryStateAssembler {
0014 private:
0015   typedef TrajectoryStateOnSurface TSOS;
0016   typedef std::vector<TrajectoryStateOnSurface> MultiTSOS;
0017 
0018 public:
0019   //
0020   // constructors
0021   //
0022   MultiTrajectoryStateAssembler();
0023 
0024   /** Adds a new TrajectoryStateOnSurface to the list 
0025    *  of components
0026    */
0027   void addState(const TrajectoryStateOnSurface);
0028 
0029   /// Adds (the weight of an) invalid state to the list
0030   void addInvalidState(const double);
0031 
0032   /** Returns the resulting MultiTrajectoryState 
0033    *  with weight = sum of all valid components.
0034    */
0035   TrajectoryStateOnSurface combinedState();
0036   /** Returns the resulting MultiTrajectoryState 
0037    *  renormalised to specified weight.
0038    */
0039   TrajectoryStateOnSurface combinedState(const float weight);
0040 
0041 private:
0042   /** Adds a vector of trajectory states
0043    *  to the list of components
0044    */
0045   void addStateVector(const MultiTSOS&);
0046   /// Checks status of combined state
0047   inline bool invalidCombinedState() const {
0048     //
0049     // Protect against empty combination (no valid input state)
0050     //
0051     return theStates.empty();
0052   }
0053   /// Preparation of combined state (cleaning & sorting)
0054   bool prepareCombinedState();
0055   /** Returns the resulting MultiTrajectoryState
0056    *  with user-supplied total weight.
0057    */
0058   TrajectoryStateOnSurface reweightedCombinedState(const double) const;
0059   /** Removes states with negligible weight (no renormalisation
0060    * of total weight!).
0061    */
0062   void removeSmallWeights();
0063   /// Removes states with local p_z != average p_z
0064   void removeWrongPz();
0065 
0066 private:
0067   bool sortStates;
0068   float minValidFraction;
0069   float minFractionalWeight;
0070 
0071   bool combinationDone;
0072   bool thePzError;
0073 
0074   double theValidWeightSum;
0075   double theInvalidWeightSum;
0076   MultiTSOS theStates;
0077 
0078   //   static TimingReport::Item * theTimerAdd;
0079   //   static TimingReport::Item * theTimerComb;
0080 };
0081 
0082 #endif