CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCSegAlgoST.h
Go to the documentation of this file.
1 #ifndef CSCSegment_CSCSegAlgoST_h
2 #define CSCSegment_CSCSegAlgoST_h
3 
26 
28 
29 #include <deque>
30 #include <vector>
31 
34 
35 
36 public:
37 
39 
40  typedef std::vector<const CSCRecHit2D*> ChamberHitContainer;
41  typedef std::vector < std::vector<const CSCRecHit2D* > > Segments;
42  typedef std::deque<bool> BoolContainer;
43 
45  explicit CSCSegAlgoST(const edm::ParameterSet& ps);
47  virtual ~CSCSegAlgoST();
48 
53  std::vector<CSCSegment> buildSegments(const ChamberHitContainer& rechits);
54 
59  std::vector<CSCSegment> buildSegments2(const ChamberHitContainer& rechits);
60 
64  std::vector<CSCSegment> run(const CSCChamber* aChamber, const ChamberHitContainer& rechits);
65 
69  std::vector< std::vector<const CSCRecHit2D*> > clusterHits(const CSCChamber* aChamber, const ChamberHitContainer & rechits);
70 
71 
72  /* Build groups of rechits that are separated in strip numbers and Z to save time on the segment finding
73  */
74  std::vector< std::vector<const CSCRecHit2D*> > chainHits(const CSCChamber* aChamber, const ChamberHitContainer & rechits);
75 
76 
81  std::vector< CSCSegment > prune_bad_hits(const CSCChamber* aChamber, std::vector< CSCSegment > & segments);
82 
83 private:
84 
86  double theWeight(double coordinate_1, double coordinate_2, double coordinate_3, float layer_1, float layer_2, float layer_3);
87 
88  void ChooseSegments(void);
89 
90  // siplistic routine - just return the segment with the smallest weight
91  void ChooseSegments2a(std::vector< ChamberHitContainer > & best_segments, int best_seg);
92  // copy of Stoyans ChooseSegments adjusted to the case without fake hits
93  void ChooseSegments2(int best_seg);
94 
95  // Choose routine with reduce nr of loops
96  void ChooseSegments3(int best_seg);
97  void ChooseSegments3(std::vector< ChamberHitContainer > & best_segments, std::vector< float > & best_weight, int best_seg);
98  //
99  void fitSlopes(void);
100  void fillChiSquared(void);
101  void fillLocalDirection(void);
102  void doSlopesAndChi2(void);
103  // Duplicates are found in ME1/1a only (i.e. only when ME1/1A is ganged)
104  void findDuplicates(std::vector<CSCSegment> & segments );
105 
106  bool isGoodToMerge(bool isME11a, ChamberHitContainer & newChain, ChamberHitContainer & oldChain);
107 
108  CLHEP::HepMatrix derivativeMatrix(void) const;
109  AlgebraicSymMatrix weightMatrix(void) const;
111  void flipErrors(AlgebraicSymMatrix&) const;
112 
113  void correctTheCovX(void);
114  void correctTheCovMatrix(CLHEP::HepMatrix &IC);
115  // Member variables
119 
122 
123  std::vector< ChamberHitContainer > Psegments;
124  std::vector< ChamberHitContainer > Psegments_noLx;
125  std::vector< ChamberHitContainer > Psegments_noL1;
126  std::vector< ChamberHitContainer > Psegments_noL2;
127  std::vector< ChamberHitContainer > Psegments_noL3;
128  std::vector< ChamberHitContainer > Psegments_noL4;
129  std::vector< ChamberHitContainer > Psegments_noL5;
130  std::vector< ChamberHitContainer > Psegments_noL6;
131  std::vector< ChamberHitContainer > chosen_Psegments;
132  std::vector< float > weight_A;
133  std::vector< float > weight_noLx_A;
134  std::vector< float > weight_noL1_A;
135  std::vector< float > weight_noL2_A;
136  std::vector< float > weight_noL3_A;
137  std::vector< float > weight_noL4_A;
138  std::vector< float > weight_noL5_A;
139  std::vector< float > weight_noL6_A;
140  std::vector< float > chosen_weight_A;
141  std::vector< float > curv_A;
142  std::vector< float > curv_noL1_A;
143  std::vector< float > curv_noL2_A;
144  std::vector< float > curv_noL3_A;
145  std::vector< float > curv_noL4_A;
146  std::vector< float > curv_noL5_A;
147  std::vector< float > curv_noL6_A;
148  std::vector< float > weight_B;
149  std::vector< float > weight_noL1_B;
150  std::vector< float > weight_noL2_B;
151  std::vector< float > weight_noL3_B;
152  std::vector< float > weight_noL4_B;
153  std::vector< float > weight_noL5_B;
154  std::vector< float > weight_noL6_B;
155 
156  //ibl
157 
162  double protoChi2;
163  double protoNDF;
165 
166  // input from .cfi file
167  bool debug;
168  // int minLayersApart;
169  // double nSigmaFromSegment;
171  // int muonsPerChamberMax;
172  // double chi2Max;
173  double dXclusBoxMax;
174  double dYclusBoxMax;
178  bool Pruning;
183 
187 
189 
192 
194  double curvePenalty;
196  //
198  bool correctCov_;
200  std::vector<double> e_Cxx;
201  double chi2Norm_2D_;
202  double chi2Norm_3D_;
203  unsigned maxContrIndex;
204  bool prePrun_;
205  double prePrunLimit_;
208  double condSeed1_, condSeed2_;
212  double covAnyNumber_;
215 };
216 
217 #endif
double yweightPenaltyThreshold
Definition: CSCSegAlgoST.h:190
double protoChiUCorrection
Allow to correct the error matrix.
Definition: CSCSegAlgoST.h:199
const std::string myName
Definition: CSCSegAlgoST.h:116
bool preClustering_useChaining
Definition: CSCSegAlgoST.h:177
bool passCondNumber
The number to fource the Covariance.
Definition: CSCSegAlgoST.h:213
void doSlopesAndChi2(void)
std::vector< ChamberHitContainer > Psegments_noL5
Definition: CSCSegAlgoST.h:129
std::vector< float > curv_noL2_A
Definition: CSCSegAlgoST.h:143
double dXclusBoxMax
Definition: CSCSegAlgoST.h:173
void correctTheCovMatrix(CLHEP::HepMatrix &IC)
const CSCChamber * theChamber
Definition: CSCSegAlgoST.h:117
std::vector< float > weight_noL4_A
Definition: CSCSegAlgoST.h:137
void correctTheCovX(void)
std::vector< float > curv_noL6_A
Definition: CSCSegAlgoST.h:147
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
Definition: CSCSegAlgoST.cc:96
std::vector< std::vector< const CSCRecHit2D * > > Segments
Definition: CSCSegAlgoST.h:41
void ChooseSegments2(int best_seg)
void ChooseSegments3(int best_seg)
std::vector< float > weight_noL3_B
Definition: CSCSegAlgoST.h:151
float protoSlope_v
Definition: CSCSegAlgoST.h:160
std::vector< ChamberHitContainer > Psegments_noL1
Definition: CSCSegAlgoST.h:125
CSCSegAlgoST(const edm::ParameterSet &ps)
Constructor.
Definition: CSCSegAlgoST.cc:33
bool isGoodToMerge(bool isME11a, ChamberHitContainer &newChain, ChamberHitContainer &oldChain)
std::vector< CSCSegment > buildSegments2(const ChamberHitContainer &rechits)
std::vector< ChamberHitContainer > chosen_Psegments
Definition: CSCSegAlgoST.h:131
std::vector< ChamberHitContainer > Psegments
Definition: CSCSegAlgoST.h:123
ChamberHitContainer protoSegment
Definition: CSCSegAlgoST.h:158
float protoSlope_u
Definition: CSCSegAlgoST.h:159
std::vector< std::vector< const CSCRecHit2D * > > clusterHits(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
double condSeed1_
Correct the error matrix for the condition number.
Definition: CSCSegAlgoST.h:209
LocalVector protoDirection
Definition: CSCSegAlgoST.h:164
std::vector< float > weight_noL3_A
Definition: CSCSegAlgoST.h:136
double hitDropLimit4Hits
Definition: CSCSegAlgoST.h:184
CSCSegAlgoShowering * showering_
Definition: CSCSegAlgoST.h:195
virtual ~CSCSegAlgoST()
Destructor.
Definition: CSCSegAlgoST.cc:91
double BPMinImprovement
Definition: CSCSegAlgoST.h:180
double covAnyNumber_
Allow to use any number for covariance for all RecHits.
Definition: CSCSegAlgoST.h:212
std::vector< ChamberHitContainer > Psegments_noLx
Definition: CSCSegAlgoST.h:124
double curvePenaltyThreshold
Definition: CSCSegAlgoST.h:193
std::vector< std::vector< const CSCRecHit2D * > > chainHits(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
std::vector< ChamberHitContainer > Psegments_noL4
Definition: CSCSegAlgoST.h:128
double protoNDF
Definition: CSCSegAlgoST.h:163
double hitDropLimit6Hits
Definition: CSCSegAlgoST.h:186
double protoChi2
Definition: CSCSegAlgoST.h:162
std::vector< float > weight_A
Definition: CSCSegAlgoST.h:132
std::vector< float > weight_noL1_B
Definition: CSCSegAlgoST.h:149
double chi2Norm_2D_
Definition: CSCSegAlgoST.h:201
std::vector< CSCSegment > buildSegments(const ChamberHitContainer &rechits)
std::vector< CSCSegment > prune_bad_hits(const CSCChamber *aChamber, std::vector< CSCSegment > &segments)
void fitSlopes(void)
std::vector< float > curv_noL5_A
Definition: CSCSegAlgoST.h:146
std::vector< ChamberHitContainer > Psegments_noL6
Definition: CSCSegAlgoST.h:130
unsigned maxContrIndex
Chi^2 normalization for the initial fit.
Definition: CSCSegAlgoST.h:203
std::vector< const CSCRecHit2D * > ChamberHitContainer
Typedefs.
Definition: CSCSegAlgoST.h:40
bool onlyBestSegment
Definition: CSCSegAlgoST.h:181
void flipErrors(AlgebraicSymMatrix &) const
std::vector< ChamberHitContainer > Psegments_noL2
Definition: CSCSegAlgoST.h:126
std::vector< float > weight_noL5_A
Definition: CSCSegAlgoST.h:138
bool passCondNumber_2
Passage the condition number calculations.
Definition: CSCSegAlgoST.h:214
AlgebraicSymMatrix weightMatrix(void) const
std::vector< float > weight_noL1_A
Definition: CSCSegAlgoST.h:134
std::vector< float > curv_noL4_A
Definition: CSCSegAlgoST.h:145
std::vector< float > weight_noL2_A
Definition: CSCSegAlgoST.h:135
std::vector< float > chosen_weight_A
Definition: CSCSegAlgoST.h:140
Segments GoodSegments
Definition: CSCSegAlgoST.h:118
bool correctCov_
Correct the Error Matrix.
Definition: CSCSegAlgoST.h:198
int minHitsPerSegment
Definition: CSCSegAlgoST.h:170
ChamberHitContainer Psegments_hits
Definition: CSCSegAlgoST.h:121
double dYclusBoxMax
Definition: CSCSegAlgoST.h:174
void findDuplicates(std::vector< CSCSegment > &segments)
std::vector< float > curv_noL1_A
Definition: CSCSegAlgoST.h:142
void fillChiSquared(void)
AlgebraicSymMatrix calculateError(void) const
bool covToAnyNumberAll_
Allow to use any number for covariance (by hand)
Definition: CSCSegAlgoST.h:211
double theWeight(double coordinate_1, double coordinate_2, double coordinate_3, float layer_1, float layer_2, float layer_3)
Utility functions.
double curvePenalty
Definition: CSCSegAlgoST.h:194
std::deque< bool > BoolContainer
Definition: CSCSegAlgoST.h:42
std::vector< float > curv_A
Definition: CSCSegAlgoST.h:141
bool prePrun_
The index of the worst x RecHit in Chi^2-X method.
Definition: CSCSegAlgoST.h:204
void ChooseSegments(void)
bool preClustering
Definition: CSCSegAlgoST.h:176
double yweightPenalty
Definition: CSCSegAlgoST.h:191
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< float > weight_noL5_B
Definition: CSCSegAlgoST.h:153
std::vector< float > weight_B
Definition: CSCSegAlgoST.h:148
float a_yweightPenaltyThreshold[5][5]
Definition: CSCSegAlgoST.h:188
void ChooseSegments2a(std::vector< ChamberHitContainer > &best_segments, int best_seg)
std::vector< double > e_Cxx
Definition: CSCSegAlgoST.h:200
CLHEP::HepMatrix derivativeMatrix(void) const
void fillLocalDirection(void)
int maxRecHitsInCluster
Definition: CSCSegAlgoST.h:175
std::vector< float > weight_noL6_A
Definition: CSCSegAlgoST.h:139
std::vector< float > weight_noL2_B
Definition: CSCSegAlgoST.h:150
bool covToAnyNumber_
The correction parameters.
Definition: CSCSegAlgoST.h:210
double hitDropLimit5Hits
Definition: CSCSegAlgoST.h:185
std::vector< float > weight_noLx_A
Definition: CSCSegAlgoST.h:133
std::vector< float > curv_noL3_A
Definition: CSCSegAlgoST.h:144
std::vector< float > weight_noL6_B
Definition: CSCSegAlgoST.h:154
ChamberHitContainer PAhits_onLayer[6]
Definition: CSCSegAlgoST.h:120
LocalPoint protoIntercept
Definition: CSCSegAlgoST.h:161
double condSeed2_
Definition: CSCSegAlgoST.h:209
std::vector< float > weight_noL4_B
Definition: CSCSegAlgoST.h:152
std::vector< ChamberHitContainer > Psegments_noL3
Definition: CSCSegAlgoST.h:127
double chi2Norm_3D_
Chi^2 normalization for the corrected fit.
Definition: CSCSegAlgoST.h:202
double prePrunLimit_
Definition: CSCSegAlgoST.h:207