Go to the documentation of this file.00001 #ifndef ANOMALOUSECALVARIABLES_H_
00002 #define ANOMALOUSECALVARIABLES_H_
00003
00004
00005 #include <memory>
00006
00007 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00008 #include "DataFormats/METReco/interface/BoundaryInformation.h"
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 class AnomalousECALVariables {
00021
00022 public:
00023 AnomalousECALVariables() {
00024
00025 v_enNeighboursGap_EB.reserve(50);
00026 v_enNeighboursGap_EE.reserve(50);
00027 v_enNeighboursGap_EB.clear();
00028 v_enNeighboursGap_EE.clear();
00029
00030
00031 v_boundaryInfoDeadCells_EB = std::vector<BoundaryInformation> ();
00032 v_boundaryInfoDeadCells_EE = std::vector<BoundaryInformation> ();
00033 v_boundaryInfoDeadCells_EB.reserve(50);
00034 v_boundaryInfoDeadCells_EE.reserve(50);
00035 v_boundaryInfoDeadCells_EB.clear();
00036 v_boundaryInfoDeadCells_EE.clear();
00037
00038 }
00039 ;
00040
00041 AnomalousECALVariables(const std::vector<BoundaryInformation>& p_enNeighboursGap_EB,
00042 const std::vector<BoundaryInformation>& p_enNeighboursGap_EE, const std::vector<BoundaryInformation>& p_boundaryInfoDeadCells_EB,
00043 const std::vector<BoundaryInformation>& p_boundaryInfoDeadCells_EE) {
00044
00045 v_boundaryInfoDeadCells_EB = std::vector<BoundaryInformation> ();
00046 v_boundaryInfoDeadCells_EE = std::vector<BoundaryInformation> ();
00047 v_boundaryInfoDeadCells_EB.reserve(50);
00048 v_boundaryInfoDeadCells_EE.reserve(50);
00049 v_boundaryInfoDeadCells_EB.clear();
00050 v_boundaryInfoDeadCells_EE.clear();
00051 v_boundaryInfoDeadCells_EB = p_boundaryInfoDeadCells_EB;
00052 v_boundaryInfoDeadCells_EE = p_boundaryInfoDeadCells_EE;
00053
00054 v_enNeighboursGap_EB = p_enNeighboursGap_EB;
00055 v_enNeighboursGap_EE = p_enNeighboursGap_EE;
00056 }
00057 ;
00058
00059 ~AnomalousECALVariables() {
00060
00061 v_enNeighboursGap_EB.clear();
00062 v_enNeighboursGap_EE.clear();
00063 v_boundaryInfoDeadCells_EB.clear();
00064 v_boundaryInfoDeadCells_EE.clear();
00065 }
00066 ;
00067
00068
00069
00070
00071
00072 bool isDeadEcalCluster(double maxBoundaryEnergy = 10,
00073 const std::vector<int>& limitDeadCellToChannelStatusEB = std::vector<int> (), const std::vector<int>& limitDeadCellToChannelStatusEE =
00074 std::vector<int> ()) const {
00075
00076 float highestEnergyDepositAroundDeadCell = 0;
00077
00078 for (int i = 0; i < (int) v_boundaryInfoDeadCells_EB.size(); ++i) {
00079 BoundaryInformation bInfo = v_boundaryInfoDeadCells_EB[i];
00080
00081
00082 bool passChannelLimitation = false;
00083 std::vector<int> status = bInfo.channelStatus;
00084
00085 for (int cs = 0; cs < (int) limitDeadCellToChannelStatusEB.size(); ++cs) {
00086 int channelAllowed = limitDeadCellToChannelStatusEB[cs];
00087
00088 for (std::vector<int>::iterator st_it = status.begin(); st_it != status.end(); ++st_it) {
00089
00090 if (channelAllowed == *st_it || (channelAllowed < 0 && abs(channelAllowed) <= *st_it)) {
00091 passChannelLimitation = true;
00092 break;
00093 }
00094 }
00095 }
00096
00097 if (passChannelLimitation || limitDeadCellToChannelStatusEB.size() == 0) {
00098
00099 if (bInfo.boundaryEnergy > highestEnergyDepositAroundDeadCell) {
00100 highestEnergyDepositAroundDeadCell = bInfo.boundaryET;
00101
00102 }
00103 }
00104 }
00105
00106 for (int i = 0; i < (int) v_boundaryInfoDeadCells_EE.size(); ++i) {
00107 BoundaryInformation bInfo = v_boundaryInfoDeadCells_EE[i];
00108
00109
00110 bool passChannelLimitation = false;
00111 std::vector<int> status = bInfo.channelStatus;
00112
00113 for (int cs = 0; cs < (int) limitDeadCellToChannelStatusEE.size(); ++cs) {
00114 int channelAllowed = limitDeadCellToChannelStatusEE[cs];
00115
00116 for (std::vector<int>::iterator st_it = status.begin(); st_it != status.end(); ++st_it) {
00117
00118 if (channelAllowed == *st_it || (channelAllowed < 0 && abs(channelAllowed) <= *st_it)) {
00119 passChannelLimitation = true;
00120 break;
00121 }
00122 }
00123 }
00124
00125 if (passChannelLimitation || limitDeadCellToChannelStatusEE.size() == 0) {
00126
00127 if (bInfo.boundaryEnergy > highestEnergyDepositAroundDeadCell){
00128 highestEnergyDepositAroundDeadCell = bInfo.boundaryET;
00129
00130 }
00131 }
00132 }
00133
00134 if (highestEnergyDepositAroundDeadCell > maxBoundaryEnergy) {
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 return true;
00160 } else
00161 return false;
00162 }
00163
00164 bool isGapEcalCluster(double maxGapEnergyEB = 10, double maxGapEnergyEE = 10) const {
00165
00166 float highestEnergyDepositAlongGapEB = 0;
00167
00168 for (int i = 0; i < (int) v_enNeighboursGap_EB.size(); ++i) {
00169 BoundaryInformation gapInfo = v_enNeighboursGap_EB[i];
00170
00171 if (gapInfo.boundaryEnergy > highestEnergyDepositAlongGapEB){
00172 highestEnergyDepositAlongGapEB = gapInfo.boundaryET;
00173
00174 }
00175 }
00176
00177 float highestEnergyDepositAlongGapEE = 0;
00178
00179 for (int i = 0; i < (int) v_enNeighboursGap_EE.size(); ++i) {
00180 BoundaryInformation gapInfo = v_enNeighboursGap_EE[i];
00181
00182 if (gapInfo.boundaryEnergy > highestEnergyDepositAlongGapEE){
00183 highestEnergyDepositAlongGapEE = gapInfo.boundaryET;
00184
00185 }
00186 }
00187
00188 if (highestEnergyDepositAlongGapEB > maxGapEnergyEB || highestEnergyDepositAlongGapEE > maxGapEnergyEE) {
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203 return true;
00204 } else
00205 return false;
00206 }
00207
00208 std::vector<BoundaryInformation> v_enNeighboursGap_EB;
00209 std::vector<BoundaryInformation> v_enNeighboursGap_EE;
00210
00211 std::vector<BoundaryInformation> v_boundaryInfoDeadCells_EB;
00212 std::vector<BoundaryInformation> v_boundaryInfoDeadCells_EE;
00213
00214 private:
00215
00216 };
00217
00218 #endif