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 
29 
30 #include <Math/Functions.h>
31 #include <Math/SVector.h>
32 #include <Math/SMatrix.h>
33 
34 #include <deque>
35 #include <vector>
36 
39 
40 
41 public:
42 
44 
45  typedef std::vector<const CSCRecHit2D*> ChamberHitContainer;
46  typedef std::vector < std::vector<const CSCRecHit2D* > > Segments;
47  typedef std::deque<bool> BoolContainer;
48 
49  // 12 x12 Symmetric
50  typedef ROOT::Math::SMatrix<double,12,12,ROOT::Math::MatRepSym<double,12> > SMatrixSym12;
51 
52  // 12 x 4
53  typedef ROOT::Math::SMatrix<double,12,4 > SMatrix12by4;
54 
55  // 4 x 4 General + Symmetric
56  typedef ROOT::Math::SMatrix<double, 4 > SMatrix4;
57  typedef ROOT::Math::SMatrix<double,4,4,ROOT::Math::MatRepSym<double,4> > SMatrixSym4;
58 
59  // 2 x 2 Symmetric
60  typedef ROOT::Math::SMatrix<double,2,2,ROOT::Math::MatRepSym<double,2> > SMatrixSym2;
61 
62  // 4-dim vector
63  typedef ROOT::Math::SVector<double,4> SVector4;
64 
65 
67  explicit CSCSegAlgoST(const edm::ParameterSet& ps);
69  virtual ~CSCSegAlgoST();
70 
75  std::vector<CSCSegment> buildSegments(const ChamberHitContainer& rechits);
76 
81  std::vector<CSCSegment> buildSegments2(const ChamberHitContainer& rechits);
82 
86  std::vector<CSCSegment> run(const CSCChamber* aChamber, const ChamberHitContainer& rechits);
87 
91  std::vector< std::vector<const CSCRecHit2D*> > clusterHits(const CSCChamber* aChamber, const ChamberHitContainer & rechits);
92 
93 
94  /* Build groups of rechits that are separated in strip numbers and Z to save time on the segment finding
95  */
96  std::vector< std::vector<const CSCRecHit2D*> > chainHits(const CSCChamber* aChamber, const ChamberHitContainer & rechits);
97 
98 
103  std::vector< CSCSegment > prune_bad_hits(const CSCChamber* aChamber, std::vector< CSCSegment > & segments);
104 
105 private:
106 
108  double theWeight(double coordinate_1, double coordinate_2, double coordinate_3, float layer_1, float layer_2, float layer_3);
109 
110  void ChooseSegments(void);
111 
112  // Return the segment with the smallest weight
113  void ChooseSegments2a(std::vector< ChamberHitContainer > & best_segments, int best_seg);
114  // Version of ChooseSegments for the case without fake hits
115  void ChooseSegments2(int best_seg);
116 
117  // Choose routine with reduce nr of loops
118  void ChooseSegments3(int best_seg);
119  void ChooseSegments3(std::vector< ChamberHitContainer > & best_segments, std::vector< float > & best_weight, int best_seg);
120  //
121  void fitSlopes(void);
122  void fillChiSquared(void);
123  void fillLocalDirection(void);
124  void doSlopesAndChi2(void);
125 
126  // Find duplicates in ME1/1a, if it has ganged strips (i.e. pre-LS1)
127  void findDuplicates(std::vector<CSCSegment> & segments );
128 
129  bool isGoodToMerge(bool isME11a, ChamberHitContainer & newChain, ChamberHitContainer & oldChain);
130 
131  // THE FOLLOWING BLITHELY PASS MATRICES AROUND LIKE CONFETTI
132  // (And that must be fixed!)
133 
134  SMatrix12by4 derivativeMatrix(void) const;
135  SMatrixSym12 weightMatrix(void) const;
136  SMatrixSym4 calculateError(void) const;
139  void correctTheCovX(void);
140 
141  void dumpSegment( const CSCSegment& seg ) const;
142  const CSCChamber* chamber() const {return theChamber;}
143 
144  // Member variables
148 
151 
152  std::vector< ChamberHitContainer > Psegments;
153  std::vector< ChamberHitContainer > Psegments_noLx;
154  std::vector< ChamberHitContainer > Psegments_noL1;
155  std::vector< ChamberHitContainer > Psegments_noL2;
156  std::vector< ChamberHitContainer > Psegments_noL3;
157  std::vector< ChamberHitContainer > Psegments_noL4;
158  std::vector< ChamberHitContainer > Psegments_noL5;
159  std::vector< ChamberHitContainer > Psegments_noL6;
160  std::vector< ChamberHitContainer > chosen_Psegments;
161  std::vector< float > weight_A;
162  std::vector< float > weight_noLx_A;
163  std::vector< float > weight_noL1_A;
164  std::vector< float > weight_noL2_A;
165  std::vector< float > weight_noL3_A;
166  std::vector< float > weight_noL4_A;
167  std::vector< float > weight_noL5_A;
168  std::vector< float > weight_noL6_A;
169  std::vector< float > chosen_weight_A;
170  std::vector< float > curv_A;
171  std::vector< float > curv_noL1_A;
172  std::vector< float > curv_noL2_A;
173  std::vector< float > curv_noL3_A;
174  std::vector< float > curv_noL4_A;
175  std::vector< float > curv_noL5_A;
176  std::vector< float > curv_noL6_A;
177  std::vector< float > weight_B;
178  std::vector< float > weight_noL1_B;
179  std::vector< float > weight_noL2_B;
180  std::vector< float > weight_noL3_B;
181  std::vector< float > weight_noL4_B;
182  std::vector< float > weight_noL5_B;
183  std::vector< float > weight_noL6_B;
184 
185  //ibl
186 
191  double protoChi2;
192  double protoNDF;
194 
195  // input from .cfi file
196  bool debug;
197  // int minLayersApart;
198  // double nSigmaFromSegment;
200  // int muonsPerChamberMax;
201  // double chi2Max;
202  double dXclusBoxMax;
203  double dYclusBoxMax;
207  bool Pruning;
212 
216 
218 
221 
223  double curvePenalty;
225 
227  bool correctCov_;
229  std::vector<double> e_Cxx;
230  double chi2Norm_2D_;
231  double chi2Norm_3D_;
232  unsigned maxContrIndex;
233  bool prePrun_;
234  double prePrunLimit_;
236 
241  double covAnyNumber_;
244 };
245 
246 #endif
double yweightPenaltyThreshold
Definition: CSCSegAlgoST.h:219
double protoChiUCorrection
Allow to correct the error matrix.
Definition: CSCSegAlgoST.h:228
const std::string myName
Definition: CSCSegAlgoST.h:145
bool preClustering_useChaining
Definition: CSCSegAlgoST.h:206
bool passCondNumber
The number to force the Covariance.
Definition: CSCSegAlgoST.h:242
void doSlopesAndChi2(void)
std::vector< ChamberHitContainer > Psegments_noL5
Definition: CSCSegAlgoST.h:158
std::vector< float > curv_noL2_A
Definition: CSCSegAlgoST.h:172
double dXclusBoxMax
Definition: CSCSegAlgoST.h:202
const CSCChamber * chamber() const
Definition: CSCSegAlgoST.h:142
void dumpSegment(const CSCSegment &seg) const
const CSCChamber * theChamber
Definition: CSCSegAlgoST.h:146
std::vector< float > weight_noL4_A
Definition: CSCSegAlgoST.h:166
void correctTheCovX(void)
std::vector< float > curv_noL6_A
Definition: CSCSegAlgoST.h:176
std::vector< CSCSegment > run(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
Definition: CSCSegAlgoST.cc:95
std::vector< std::vector< const CSCRecHit2D * > > Segments
Definition: CSCSegAlgoST.h:46
void ChooseSegments2(int best_seg)
void ChooseSegments3(int best_seg)
std::vector< float > weight_noL3_B
Definition: CSCSegAlgoST.h:180
float protoSlope_v
Definition: CSCSegAlgoST.h:189
std::vector< ChamberHitContainer > Psegments_noL1
Definition: CSCSegAlgoST.h:154
CSCSegAlgoST(const edm::ParameterSet &ps)
Constructor.
Definition: CSCSegAlgoST.cc:31
bool isGoodToMerge(bool isME11a, ChamberHitContainer &newChain, ChamberHitContainer &oldChain)
std::vector< CSCSegment > buildSegments2(const ChamberHitContainer &rechits)
void correctTheCovMatrix(SMatrixSym2 &IC)
std::vector< ChamberHitContainer > chosen_Psegments
Definition: CSCSegAlgoST.h:160
std::vector< ChamberHitContainer > Psegments
Definition: CSCSegAlgoST.h:152
ChamberHitContainer protoSegment
Definition: CSCSegAlgoST.h:187
ROOT::Math::SVector< double, 4 > SVector4
Definition: CSCSegAlgoST.h:63
float protoSlope_u
Definition: CSCSegAlgoST.h:188
std::vector< std::vector< const CSCRecHit2D * > > clusterHits(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
double condSeed1_
The upper limit of protoChiUCorrection to apply prePrun.
Definition: CSCSegAlgoST.h:238
LocalVector protoDirection
Definition: CSCSegAlgoST.h:193
std::vector< float > weight_noL3_A
Definition: CSCSegAlgoST.h:165
double hitDropLimit4Hits
Definition: CSCSegAlgoST.h:213
CSCSegAlgoShowering * showering_
Definition: CSCSegAlgoST.h:224
virtual ~CSCSegAlgoST()
Destructor.
Definition: CSCSegAlgoST.cc:90
double BPMinImprovement
Definition: CSCSegAlgoST.h:209
double covAnyNumber_
Allow to use any number for covariance for all RecHits.
Definition: CSCSegAlgoST.h:241
std::vector< ChamberHitContainer > Psegments_noLx
Definition: CSCSegAlgoST.h:153
double curvePenaltyThreshold
Definition: CSCSegAlgoST.h:222
std::vector< std::vector< const CSCRecHit2D * > > chainHits(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
std::vector< ChamberHitContainer > Psegments_noL4
Definition: CSCSegAlgoST.h:157
double protoNDF
Definition: CSCSegAlgoST.h:192
double hitDropLimit6Hits
Definition: CSCSegAlgoST.h:215
double protoChi2
Definition: CSCSegAlgoST.h:191
std::vector< float > weight_A
Definition: CSCSegAlgoST.h:161
std::vector< float > weight_noL1_B
Definition: CSCSegAlgoST.h:178
double chi2Norm_2D_
Definition: CSCSegAlgoST.h:230
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:175
std::vector< ChamberHitContainer > Psegments_noL6
Definition: CSCSegAlgoST.h:159
SMatrix12by4 derivativeMatrix(void) const
unsigned maxContrIndex
Chi^2 normalization for the initial fit.
Definition: CSCSegAlgoST.h:232
std::vector< const CSCRecHit2D * > ChamberHitContainer
Typedefs.
Definition: CSCSegAlgoST.h:45
bool onlyBestSegment
Definition: CSCSegAlgoST.h:210
std::vector< ChamberHitContainer > Psegments_noL2
Definition: CSCSegAlgoST.h:155
ROOT::Math::SMatrix< double, 4 > SMatrix4
Definition: CSCSegAlgoST.h:56
std::vector< float > weight_noL5_A
Definition: CSCSegAlgoST.h:167
bool passCondNumber_2
Passage the condition number calculations.
Definition: CSCSegAlgoST.h:243
ROOT::Math::SMatrix< double, 12, 12, ROOT::Math::MatRepSym< double, 12 > > SMatrixSym12
Definition: CSCSegAlgoST.h:50
std::vector< float > weight_noL1_A
Definition: CSCSegAlgoST.h:163
std::vector< float > curv_noL4_A
Definition: CSCSegAlgoST.h:174
std::vector< float > weight_noL2_A
Definition: CSCSegAlgoST.h:164
std::vector< float > chosen_weight_A
Definition: CSCSegAlgoST.h:169
Segments GoodSegments
Definition: CSCSegAlgoST.h:147
bool correctCov_
Correct the Error Matrix.
Definition: CSCSegAlgoST.h:227
int minHitsPerSegment
Definition: CSCSegAlgoST.h:199
ChamberHitContainer Psegments_hits
Definition: CSCSegAlgoST.h:150
double dYclusBoxMax
Definition: CSCSegAlgoST.h:203
void findDuplicates(std::vector< CSCSegment > &segments)
std::vector< float > curv_noL1_A
Definition: CSCSegAlgoST.h:171
void fillChiSquared(void)
SMatrixSym4 calculateError(void) const
bool covToAnyNumberAll_
Allow to use any number for covariance (by hand)
Definition: CSCSegAlgoST.h:240
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:223
std::deque< bool > BoolContainer
Definition: CSCSegAlgoST.h:47
std::vector< float > curv_A
Definition: CSCSegAlgoST.h:170
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > SMatrixSym4
Definition: CSCSegAlgoST.h:57
bool prePrun_
The index of the worst x RecHit in Chi^2-X method.
Definition: CSCSegAlgoST.h:233
ROOT::Math::SMatrix< double, 12, 4 > SMatrix12by4
Definition: CSCSegAlgoST.h:53
void ChooseSegments(void)
bool preClustering
Definition: CSCSegAlgoST.h:205
double yweightPenalty
Definition: CSCSegAlgoST.h:220
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< float > weight_noL5_B
Definition: CSCSegAlgoST.h:182
std::vector< float > weight_B
Definition: CSCSegAlgoST.h:177
float a_yweightPenaltyThreshold[5][5]
Definition: CSCSegAlgoST.h:217
void ChooseSegments2a(std::vector< ChamberHitContainer > &best_segments, int best_seg)
std::vector< double > e_Cxx
Definition: CSCSegAlgoST.h:229
void fillLocalDirection(void)
int maxRecHitsInCluster
Definition: CSCSegAlgoST.h:204
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > SMatrixSym2
Definition: CSCSegAlgoST.h:60
std::vector< float > weight_noL6_A
Definition: CSCSegAlgoST.h:168
std::vector< float > weight_noL2_B
Definition: CSCSegAlgoST.h:179
bool covToAnyNumber_
The correction parameters.
Definition: CSCSegAlgoST.h:239
double hitDropLimit5Hits
Definition: CSCSegAlgoST.h:214
std::vector< float > weight_noLx_A
Definition: CSCSegAlgoST.h:162
std::vector< float > curv_noL3_A
Definition: CSCSegAlgoST.h:173
std::vector< float > weight_noL6_B
Definition: CSCSegAlgoST.h:183
SMatrixSym12 weightMatrix(void) const
AlgebraicSymMatrix flipErrors(const SMatrixSym4 &) const
ChamberHitContainer PAhits_onLayer[6]
Definition: CSCSegAlgoST.h:149
LocalPoint protoIntercept
Definition: CSCSegAlgoST.h:190
double condSeed2_
Definition: CSCSegAlgoST.h:238
std::vector< float > weight_noL4_B
Definition: CSCSegAlgoST.h:181
std::vector< ChamberHitContainer > Psegments_noL3
Definition: CSCSegAlgoST.h:156
double chi2Norm_3D_
Chi^2 normalization for the corrected fit.
Definition: CSCSegAlgoST.h:231
double prePrunLimit_
Definition: CSCSegAlgoST.h:235