00001
00002
00003
00004
00005
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef CLUSTERSUMMARY
00021 #define CLUSTERSUMMARY
00022
00023
00024 #include <memory>
00025 #include <string>
00026 #include <map>
00027 #include <vector>
00028 #include<iostream>
00029 #include <string.h>
00030 #include <sstream>
00031 #include "FWCore/Utilities/interface/Exception.h"
00032
00033
00034
00035 #include "FWCore/Framework/interface/Frameworkfwd.h"
00036 #include "DataFormats/SiStripCluster/interface/SiStripCluster.h"
00037 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
00038 #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
00039 #include "DataFormats/Common/interface/DetSetVectorNew.h"
00040
00041
00042 #include "RecoLocalTracker/SiStripClusterizer/interface/SiStripClusterInfo.h"
00043 #include "DataFormats/SiStripDigi/interface/SiStripProcessedRawDigi.h"
00044 #include "DataFormats/Common/interface/DetSetVector.h"
00045
00046 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
00047 #include "DataFormats/DetId/interface/DetId.h"
00048 #include "DataFormats/SiStripDetId/interface/TIBDetId.h"
00049 #include "DataFormats/SiStripDetId/interface/TOBDetId.h"
00050 #include "DataFormats/SiStripDetId/interface/TIDDetId.h"
00051 #include "DataFormats/SiStripDetId/interface/TECDetId.h"
00052 #include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
00053 #include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
00054 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
00055 #include "DataFormats/SiPixelDetId/interface/PixelBarrelName.h"
00056 #include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h"
00057 #include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetType.h"
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126 class ClusterSummary {
00127
00128 public:
00129
00130 ClusterSummary():genericVariablesTmp_(6, std::vector<double>(100,0) ){}
00131
00132
00133 enum CMSTracker { TRACKER = 0,
00134 TIB = 1,
00135 TIB_1 = 11, TIB_2 = 12, TIB_3 = 13, TIB_4 = 14,
00136 TOB = 2,
00137 TOB_1 = 21, TOB_2 = 22, TOB_3 = 23, TOB_4 = 24, TOB_5 = 25, TOB_6 = 26,
00138 TID = 3,
00139 TIDM = 31, TIDP = 32,
00140 TIDM_1 = 311, TIDM_2 = 312, TIDM_3 = 313,
00141 TIDP_1 = 321, TIDP_2 = 322, TIDP_3 = 323,
00142 TIDMR_1 = 3110, TIDMR_2 = 3120, TIDMR_3 = 3130,
00143 TIDPR_1 = 3210, TIDPR_2 = 3220, TIDPR_3 = 3230,
00144 TEC = 4,
00145 TECM = 41, TECP = 42,
00146 TECM_1 = 411, TECM_2 = 412, TECM_3 = 413, TECM_4 = 414, TECM_5 = 415, TECM_6 = 416, TECM_7 = 417, TECM_8 = 418, TECM_9 = 419,
00147 TECP_1 = 421, TECP_2 = 422, TECP_3 = 423, TECP_4 = 424, TECP_5 = 425, TECP_6 = 426, TECP_7 = 427, TECP_8 = 428, TECP_9 = 429,
00148 TECMR_1 = 4110, TECMR_2 = 4120, TECMR_3 = 4130, TECMR_4 = 4140, TECMR_5 = 4150, TECMR_6 = 4160, TECMR_7 = 4170,
00149 TECPR_1 = 4210, TECPR_2 = 4220, TECPR_3 = 4230, TECPR_4 = 4240, TECPR_5 = 4250, TECPR_6 = 4260, TECPR_7 = 4270,
00150
00151 PIXEL = 5,
00152 FPIX = 6,
00153 FPIX_1 = 61,FPIX_2 = 62,FPIX_3 = 63,
00154 FPIXM = 611, FPIXP = 612,
00155 FPIXM_1 = 6110, FPIXM_2 = 6120, FPIXM_3 = 6130,
00156 FPIXP_1 = 6210, FPIXP_2 = 6220, FPIXP_3 = 6230,
00157 BPIX = 7,
00158 BPIX_1 = 71, BPIX_2 = 72, BPIX_3 = 73
00159
00160 };
00161
00162
00163 enum VariablePlacement{ NMODULES = 0,
00164 CLUSTERSIZE = 1,
00165 CLUSTERCHARGE = 2,
00166 NMODULESPIXELS = 3,
00167 CLUSTERSIZEPIXELS = 4,
00168 CLUSTERCHARGEPIXELS = 5};
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180 double GetGenericVariable( int variableLocation, int module ) const {
00181 return GetModuleLocation(module) < 0 ? 0. : genericVariables_[variableLocation][GetModuleLocation(module)]; }
00182
00183
00184 double GetGenericVariable( std::string variableName, int module ) const {
00185
00186 int position = GetVariableLocation(variableName);
00187 int mposition = GetModuleLocation(module);
00188
00189 return mposition < 0 ? 0. : genericVariables_[position][mposition];
00190 }
00191
00192
00193 std::vector<double> GetGenericVariable( std::string variableName ) const {
00194 return genericVariables_[GetVariableLocation(variableName)];
00195 }
00196
00197
00198 std::vector<double> GetGenericVariable( int variableLocation ) const {
00199 return genericVariables_[variableLocation];
00200 }
00201
00202
00203 std::vector< std::vector<double> > GetGenericVariable() const { return genericVariables_; }
00204
00205
00206 void SetGenericVariable( int variableLocation, int module, double value ) {
00207 if(GetModuleLocation(module) >=0) genericVariablesTmp_[variableLocation][GetModuleLocation(module)] += value; }
00208
00209
00210 void SetGenericVariable( std::string variableName, int module, double value ) {
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222 int position = GetVariableLocation(variableName);
00223 int mposition = GetModuleLocation(module);
00224
00225 if(mposition >=0) genericVariablesTmp_[position][mposition] += value;
00226 }
00227
00228
00229 void PrepairGenericVariable() {
00230
00231 genericVariables_ = genericVariablesTmp_;
00232
00233 for (unsigned int i = 0; i < userContent.size(); ++i){
00234 genericVariables_[i].erase(std::remove(genericVariables_[i].begin(), genericVariables_[i].end(), 0), genericVariables_[i].end());
00235 }
00236 }
00237
00238
00239 void ClearGenericVariable() {
00240
00241
00242
00243 for (unsigned int i = 0; i < genericVariablesTmp_.size(); ++i){
00244 for (unsigned int j = 0; j < genericVariablesTmp_[i].size(); ++j){
00245 genericVariablesTmp_[i][j] = 0;
00246 }
00247 }
00248 }
00249
00250
00251
00252
00253 void SetUserContent(std::vector<std::string> Content) const { userContent = Content;}
00254 std::vector<std::string> GetUserContent() { return userContent;}
00255 int GetUserContentSize() { return userContent.size(); }
00256 void GetUserContentInfo() const {
00257 std::cout << "Saving info for " ;
00258 for (unsigned int i = 0; i < userContent.size(); ++i){ std::cout << userContent.at(i) << " " ;}
00259 std::cout << std::endl;
00260 }
00261 int GetVariableLocation ( std::string var ) const;
00262
00263
00264
00265 void SetUserModules( int value ) { modules_.push_back( value ); }
00266 std::vector<int> GetUserModules( ) const { return modules_; }
00267 void ClearUserModules( ) { modules_.clear(); }
00268
00269 int GetModuleLocation ( int mod ) const;
00270
00271
00272
00273 void SetUserIterator() { iterator_.push_back( GetUserContentSize() );}
00274 std::vector<int> GetUserIterator() const { return iterator_; }
00275 void ClearUserIterator() { iterator_.clear(); }
00276
00277
00278 std::vector<std::string> DecodeProvInfo(std::string ProvInfo) const;
00279
00280
00281 class ModuleSelection{
00282 public:
00283 ModuleSelection(std::string gs);
00284 virtual ~ModuleSelection();
00285 virtual std::pair<int,int> IsStripSelected (int DetId);
00286 virtual std::pair<int,int> IsPixelSelected (int DetId);
00287 private:
00288 std::string geosearch;
00289 };
00290
00291
00292
00293
00294 private:
00295
00296
00297
00298 mutable std::vector<std::string> userContent;
00299
00300 std::vector<int> iterator_;
00301 std::vector<int> modules_;
00302
00303 std::vector< std::vector<double> > genericVariables_;
00304 mutable std::vector< std::vector<double> > genericVariablesTmp_;
00305
00306 };
00307
00308
00309 #endif
00310
00311
00312
00313
00314
00315
00316