00001
00002
00003
00004
00005
00006
00007 #include "FWCore/Common/interface/TriggerNames.h"
00008
00009 #include "HLTriggerOffline/special/src/HaloTrigger.h"
00010
00011 #include "DQMServices/Core/interface/DQMStore.h"
00012
00013 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00014 #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
00015 #include "DataFormats/CSCRecHit/interface/CSCRangeMapAccessor.h"
00016 #include "Geometry/CSCGeometry/interface/CSCChamber.h"
00017
00018 #include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h"
00019 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
00020 #include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
00021 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
00022 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h"
00023 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
00024 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerEvmReadoutRecord.h"
00025 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"
00026 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCStatusDigiCollection.h"
00027 #include "DataFormats/MuonDetId/interface/CSCTriggerNumbering.h"
00028 #include "DataFormats/Common/interface/Handle.h"
00029 #include "DataFormats/Common/interface/TriggerResults.h"
00030 #include "FWCore/Framework/interface/ESHandle.h"
00031 #include "FWCore/Framework/interface/MakerMacros.h"
00032 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
00033 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
00034
00035 #include "Geometry/Records/interface/MuonGeometryRecord.h"
00036
00037 #include "L1Trigger/CSCCommonTrigger/interface/CSCTriggerGeometry.h"
00038 #include "L1Trigger/CSCTrackFinder/interface/CSCTrackFinderDataTypes.h"
00039 #include "L1Trigger/CSCCommonTrigger/interface/CSCTriggerGeometry.h"
00040
00041 #include <iostream>
00042 #include <iomanip>
00043 #include <memory>
00044
00045 using namespace std;
00046 using namespace edm;
00047 using namespace trigger;
00048
00049 HaloTrigger::HaloTrigger(const ParameterSet& ps)
00050 {
00051
00052
00053
00054 dbe = Service<DQMStore>().operator->();
00055 dbe->setVerbose(0);
00056
00057
00058 first = false;
00059 outFile = ps.getUntrackedParameter<string>("outFile");
00060
00061 HLTriggerTag = ps.getParameter< edm::InputTag >("HLTriggerTag");
00062 GMTInputTag = ps.getParameter< edm::InputTag >("GMTInputTag");
00063 lctProducer = ps.getParameter< edm::InputTag >("LCTInputTag");
00064 cscRecHitLabel = ps.getParameter< edm::InputTag >("RecInputTag");
00065
00066 }
00067
00068 HaloTrigger::~HaloTrigger()
00069 {}
00070
00071 void HaloTrigger::beginJob()
00072 {
00074
00076 hltHaloTriggers = 0;
00077 hltHaloOver1 = 0;
00078 hltHaloOver2 = 0;
00079 hltHaloRing23 = 0;
00080 CscHalo_Gmt = 0;
00081
00083
00085 DQMStore * dbe = 0;
00086 dbe = Service<DQMStore>().operator->();
00087 if( dbe ){
00088 dbe->setCurrentFolder("HLTriggerOffline/special");
00089
00091
00093 PlusMe1BeamHaloOcc = dbe->book2D("PlusMe1BeamHaloOcc","Positive Endcap, Me1 Beam Halo Occupancy",1000,-500,500,1000,-500,500);
00094 PlusMe1BeamHaloOccRing1 = dbe->book2D("PlusMe1BeamHaloOccRing1","Positive Endcap, Me1 Beam Halo Occupancy, HLT Trig Ring1",1000,-500,500,1000,-500,500);
00095 PlusMe1BeamHaloOccRing2 = dbe->book2D("PlusMe1BeamHaloOccRing2","Positive Endcap, Me1 Beam Halo Occupancy, HLT Trig Ring2",1000,-500,500,1000,-500,500);
00096 PlusMe1BeamHaloOccRing2or3 = dbe->book2D("PlusMe1BeamHaloOccRing2or3","Positive Endcap, Me1 Beam Halo Occupancy, HLT Trig Ring 2 or 3",1000,-500,500,1000,-500,500);
00097 PlusMe1BeamHaloOccRad = dbe->book1D("PlusMe1BeamHaloOccRad","Positive Endcap, Me1 Beam Halo Radial Occupancy",750,0,750);
00098
00099 PlusMe2BeamHaloOcc = dbe->book2D("PlusMe2BeamHaloOcc","Positive Endcap, Me2 Beam Halo Occupancy",1000,-500,500,1000,-500,500);
00100 PlusMe2BeamHaloOccRing1 = dbe->book2D("PlusMe2BeamHaloOccRing1","Positive Endcap, Me2 Beam Halo Occupancy, HLT Trig Ring1",1000,-500,500,1000,-500,500);
00101 PlusMe2BeamHaloOccRing2 = dbe->book2D("PlusMe2BeamHaloOccRing2","Positive Endcap, Me2 Beam Halo Occupancy, HLT Trig Ring2",1000,-500,500,1000,-500,500);
00102 PlusMe2BeamHaloOccRing2or3 = dbe->book2D("PlusMe2BeamHaloOccRing2or3","Positive Endcap, Me2 Beam Halo Occupancy, HLT Trig Ring 2 or 3",1000,-500,500,1000,-500,500);
00103
00104 PlusMe3BeamHaloOcc = dbe->book2D("PlusMe3BeamHaloOcc","Positive Endcap, Me3 Beam Halo Occupancy",1000,-500,500,1000,-500,500);
00105 PlusMe3BeamHaloOccRing1 = dbe->book2D("PlusMe3BeamHaloOccRing1","Positive Endcap, Me3 Beam Halo Occupancy, HLT Trig Ring1",1000,-500,500,1000,-500,500);
00106 PlusMe3BeamHaloOccRing2 = dbe->book2D("PlusMe3BeamHaloOccRing2","Positive Endcap, Me3 Beam Halo Occupancy, HLT Trig Ring2",1000,-500,500,1000,-500,500);
00107 PlusMe3BeamHaloOccRing2or3 = dbe->book2D("PlusMe3BeamHaloOccRing2or3","Positive Endcap, Me3 Beam Halo Occupancy, HLT Trig Ring 2 or 3",1000,-500,500,1000,-500,500);
00108
00109 PlusMe4BeamHaloOcc = dbe->book2D("PlusMe4BeamHaloOcc","Positive Endcap, Me4 Beam Halo Occupancy",1000,-500,500,1000,-500,500);
00110 PlusMe4BeamHaloOccRing1 = dbe->book2D("PlusMe4BeamHaloOccRing1","Positive Endcap, Me4 Beam Halo Occupancy, HLT Trig Ring1",1000,-500,500,1000,-500,500);
00111 PlusMe4BeamHaloOccRing2 = dbe->book2D("PlusMe4BeamHaloOccRing2","Positive Endcap, Me4 Beam Halo Occupancy, HLT Trig Ring2",1000,-500,500,1000,-500,500);
00112 PlusMe4BeamHaloOccRing2or3 = dbe->book2D("PlusMe4BeamHaloOccRing2or3","Positive Endcap, Me4 Beam Halo Occupancy, HLT Trig Ring 2 or 3",1000,-500,500,1000,-500,500);
00113
00114 MinusMe1BeamHaloOcc = dbe->book2D("MinusMe1Me1BeamHaloOcc","Negative Endcap, Me1 Beam Halo Occupancy",1000,-500,500,1000,-500,500);
00115 MinusMe1BeamHaloOccRing1 = dbe->book2D("MinusBeamHaloOccRing1","Negative Endcap, Me1 Beam Halo Occupancy, HLT Trig Ring1",1000,-500,500,1000,-500,500);
00116 MinusMe1BeamHaloOccRing2 = dbe->book2D("MinusMe1BeamHaloOccRing2","Negative Endcap, Me1 Beam Halo Occupancy, HLT Trig Ring2",1000,-500,500,1000,-500,500);
00117 MinusMe1BeamHaloOccRing2or3 = dbe->book2D("MinusMe1BeamHaloOccRing2or3","Negative Endcap, Me1 Beam Halo Occupancy, HLT Trig Ring 2 or 3",1000,-500,500,1000,-500,500);
00118 MinusMe1BeamHaloOccRad = dbe->book1D("MinusMe1BeamHaloOccRad","Minus Endcap, Me1 Beam Halo Radial Occupancy",750,0,750);
00119
00120 MinusMe2BeamHaloOcc = dbe->book2D("MinusMe2BeamHaloOcc","Negative Endcap, Me2 Beam Halo Occupancy",1000,-500,500,1000,-500,500);
00121 MinusMe2BeamHaloOccRing1 = dbe->book2D("MinusMe2BeamHaloOccRing1","Negative Endcap, Me2 Beam Halo Occupancy, HLT Trig Ring1",1000,-500,500,1000,-500,500);
00122 MinusMe2BeamHaloOccRing2 = dbe->book2D("MinusMe2BeamHaloOccRing2","Negative Endcap, Me2 Beam Halo Occupancy, HLT Trig Ring2",1000,-500,500,1000,-500,500);
00123 MinusMe2BeamHaloOccRing2or3 = dbe->book2D("MinusMe2BeamHaloOccRing2or3","Negative Endcap, Me2 Beam Halo Occupancy, HLT Trig Ring 2 or 3",1000,-500,500,1000,-500,500);
00124
00125 MinusMe3BeamHaloOcc = dbe->book2D("MinusMe3BeamHaloOcc","Negative Endcap, Me3 Beam Halo Occupancy",1000,-500,500,1000,-500,500);
00126 MinusMe3BeamHaloOccRing1 = dbe->book2D("MinusMe3BeamHaloOccRing1","Negative Endcap, Me3 Beam Halo Occupancy, HLT Trig Ring1",1000,-500,500,1000,-500,500);
00127 MinusMe3BeamHaloOccRing2 = dbe->book2D("MinusMe3BeamHaloOccRing2","Negative Endcap, Me3 Beam Halo Occupancy, HLT Trig Ring2",1000,-500,500,1000,-500,500);
00128 MinusMe3BeamHaloOccRing2or3 = dbe->book2D("MinusMe3BeamHaloOccRing2or3","Negative Endcap, Me3 Beam Halo Occupancy, HLT Trig Ring 2 or 3",1000,-500,500,1000,-500,500);
00129
00130 MinusMe4BeamHaloOcc = dbe->book2D("MinusMe4BeamHaloOcc","Negative Endcap, Me4 Beam Halo Occupancy",1000,-500,500,1000,-500,500);
00131 MinusMe4BeamHaloOccRing1 = dbe->book2D("MinusMe4BeamHaloOccRing1","Negative Endcap, Me4 Beam Halo Occupancy, HLT Trig Ring1",1000,-500.,500.,1000,-500.,500.);
00132 MinusMe4BeamHaloOccRing2 = dbe->book2D("MinusMe4BeamHaloOccRing2","Negative Endcap, Me4 Beam Halo Occupancy, HLT Trig Ring2",1000,-500,500,1000,-500,500);
00133 MinusMe4BeamHaloOccRing2or3 = dbe->book2D("MinusMe4BeamHaloOccRing2or3","Negative Endcap, Me4 Beam Halo Occupancy, HLT Trig Ring 2 or 3",1000,-500,500,1000,-500,500);
00134
00135 MinusMe3BeamHaloOccRing2Unfold = dbe->book2D("MinusMe3BeamHaloOccRing2Unfold","Negative Endcap Me3, Ring 2 Unfolded",120,-1,11,500,-2.4,-0.9);
00136 MinusMe2BeamHaloOccRing2Unfold = dbe->book2D("MinusMe2BeamHaloOccRing2Unfold","Negative Endcap Me2, Ring 2 Unfolded",120,-1,11,500,-2.4,-0.9);
00137 PlusMe3BeamHaloOccRing2Unfold = dbe->book2D("PlusMe3BeamHaloOccRing2Unfold","Negative Endcap Me3, Ring 2 Unfolded",120,-1,11,500,0.9,2.4);
00138 PlusMe2BeamHaloOccRing2Unfold = dbe->book2D("PlusMe2BeamHaloOccRing2Unfold","Negative Endcap Me2, Ring 2 Unfolded",120,-1,11,500,0.9,2.4);
00139
00140 MinusMe3BeamHaloOccRing1Unfold = dbe->book2D("MinusMe3BeamHaloOccRing1Unfold","Negative Endcap Me3, Ring 1 Unfolded",120,-1,11,500,-2.5,-0.9);
00141 MinusMe2BeamHaloOccRing1Unfold = dbe->book2D("MinusMe2BeamHaloOccRing1Unfold","Negative Endcap Me2, Ring 1 Unfolded",120,-1,11,500,-2.5,-0.9);
00142 PlusMe3BeamHaloOccRing1Unfold = dbe->book2D("PlusMe3BeamHaloOccRing1Unfold","Negative Endcap Me3, Ring 1 Unfolded",120,-1,11,500,0.9,2.5);
00143 PlusMe2BeamHaloOccRing1Unfold = dbe->book2D("PlusMe2BeamHaloOccRing1Unfold","Negative Endcap Me2, Ring 1 Unfolded",120,-1,11,500,0.9,2.5);
00144
00145 MinusEff = dbe->bookProfile("MinusEff", "Minus Endcap Efficiency by Vertex",50,0,750,50,0,1);
00146 MinusEff->setAxisTitle("Radius",1);
00147 MinusEff->setAxisTitle("Efficiency",2);
00148
00149 MinusEffProj3 = dbe->book1D("MinusEffProj3","Minus Endcap Efficiency by projection",50,0,750);
00150 MinusEffProj3->setBinLabel(1,"0",1);
00151 MinusEffProj3->setBinLabel(10,"150",1);
00152 MinusEffProj3->setBinLabel(20,"300",1);
00153 MinusEffProj3->setBinLabel(30,"450",1);
00154 MinusEffProj3->setBinLabel(40,"600",1);
00155 MinusEffProj3->setBinLabel(50,"750",1);
00156 MinusEffProj3->setAxisTitle("Radius",1);
00157 MinusEffProj3->setAxisTitle("Efficiency",2);
00158 MinusEffNum = dbe->book1D("MinusEffNum", "Minus Endcap numerator",50,0,750);
00159 MinusEffDen = dbe->book1D("MinusEffDen", "Minus Endcap denomenator", 50, 0, 750);
00160 PlusEff = dbe->bookProfile("PlusEff", "Plus Endcap Efficiency by Vertex",50,0,750,50,0,1);
00161 PlusEff->setAxisTitle("Radius",1);
00162 PlusEff->setAxisTitle("Efficiency",2);
00163
00164 PlusEffProj3 = dbe->book1D("PlusEffProj3","Plus Endcap Efficiency by projection",50,0,750);
00165 PlusEffProj3->setAxisTitle("Radius",1);
00166 PlusEffProj3->setAxisTitle("Efficiency",2);
00167 PlusEffProj3->setBinLabel(1,"0",1);
00168 PlusEffProj3->setBinLabel(10,"150",1);
00169 PlusEffProj3->setBinLabel(20,"300",1);
00170 PlusEffProj3->setBinLabel(30,"450",1);
00171 PlusEffProj3->setBinLabel(40,"600",1);
00172 PlusEffProj3->setBinLabel(50,"750",1);
00173 PlusEffNum = dbe->book1D("PlusEffNum", "Plus Endcap numerator",50,0,750);
00174 PlusEffDen = dbe->book1D("PlusEffDen", "Plus Endcap denomenator", 50, 0, 750);
00175 }
00176
00177
00178 for( int i=0; i<50; ++i)
00179 {
00180 numCountPlus[i] = 0;
00181 denCountPlus[i] = 0;
00182 numCountMinus[i] = 0;
00183 denCountMinus[i] = 0;
00184 }
00185 }
00186
00187 void HaloTrigger::endJob(void)
00188 {
00189 for(int j=1;j<51;j++)
00190 {
00191 if(denCountPlus[j] != 0)
00192 {
00193 float fillValuePlus = numCountPlus[j]/denCountPlus[j];
00194 PlusEffProj3->setBinContent(j,fillValuePlus);
00195 }
00196
00197 if(denCountMinus[j] != 0)
00198 {
00199 float fillValueMinus = numCountMinus[j]/denCountMinus[j];
00200 MinusEffProj3->setBinContent(j,fillValueMinus);
00201 }
00202 }
00203
00204
00205
00206 dbe->save(outFile);
00207 return;
00208 }
00209
00210 void HaloTrigger::analyze(const Event& e, const EventSetup& es)
00211 {
00212
00213
00214 es.get<MuonGeometryRecord>().get(m_cscGeometry);
00215
00216 edm::Handle<edm::SimVertexContainer> simvertices_handle;
00217 e.getByLabel("g4SimHits",simvertices_handle);
00218 edm::SimVertexContainer const* simvertices = simvertices_handle.product();
00219
00220 edm::Handle<edm::SimTrackContainer> simtracks_handle;
00221 e.getByLabel("g4SimHits",simtracks_handle);
00222 edm::SimTrackContainer const* simtracks = simtracks_handle.product();
00223
00224 float vtxArray[7];
00225 for(int jj=0; jj<7; jj++) vtxArray[jj] = 0;
00226 edm::SimTrackContainer::const_iterator isimtr;
00227 for(isimtr=simtracks->begin(); isimtr!=simtracks->end(); isimtr++) {
00228 if( (*simvertices)[(*isimtr).vertIndex()].position().z() > 2299 ){
00229 vtxArray[1] = 1;
00230 vtxArray[2] = (*simvertices)[(*isimtr).vertIndex()].position().x();
00231 vtxArray[3] = (*simvertices)[(*isimtr).vertIndex()].position().y();
00232 vtxArray[4] = (*isimtr).momentum().px();
00233 vtxArray[5] = (*isimtr).momentum().py();
00234 vtxArray[6] = (*isimtr).momentum().pz();
00235 }
00236
00237 if( (*simvertices)[(*isimtr).vertIndex()].position().z() < -2299 ){
00238 vtxArray[1] = -1;
00239 vtxArray[2] = (*simvertices)[(*isimtr).vertIndex()].position().x();
00240 vtxArray[3] = (*simvertices)[(*isimtr).vertIndex()].position().y();
00241 vtxArray[4] = (*isimtr).momentum().px();
00242 vtxArray[5] = (*isimtr).momentum().py();
00243 vtxArray[6] = (*isimtr).momentum().pz();
00244 }
00245 }
00246
00247 if( HLTriggerTag.label() != "null" )
00248 {
00249 edm::Handle<TriggerResults> trh;
00250 e.getByLabel(HLTriggerTag,trh);
00251
00253
00255 if (!first)
00256 {
00257 first = true;
00258 edm::TriggerNames const& triggerNames = e.triggerNames(*trh);
00259 Namen = triggerNames.triggerNames();
00260 const unsigned int n(Namen.size());
00261 std::string searchName_Halo0 ("HLT_CSCBeamHalo");
00262 std::string searchName_Halo1 ("HLT_CSCBeamHaloOverlapRing1");
00263 std::string searchName_Halo2 ("HLT_CSCBeamHaloOverlapRing2");
00264 std::string searchName_Halo3 ("HLT_CSCBeamHaloRing2or3");
00265 for( unsigned int i=0; i!=n; ++i){
00266 int compy = Namen[i].compare(searchName_Halo0);
00267 if( compy == 0) majikNumber0 = i;
00268
00269 compy = Namen[i].compare(searchName_Halo1);
00270 if( compy == 0) majikNumber1 = i;
00271
00272 compy = Namen[i].compare(searchName_Halo2);
00273 if( compy == 0) majikNumber2 = i;
00274
00275 compy = Namen[i].compare(searchName_Halo3);
00276 if( compy == 0) majikNumber3 = i;
00277 }
00278 }
00279
00281
00283 bool haloTriggerAny = false;
00284 bool halo0 = false, halo1 = false, halo2 = false, halo3 = false;
00285 const unsigned int n(Namen.size());
00286 for( unsigned int j=0; j!=n; ++j)
00287 {
00288 if( (j == majikNumber0) && (trh->accept(j)) )
00289 {
00290 halo0 = true;
00291 haloTriggerAny = true;
00292 }
00293
00294 if( (j == majikNumber1) && (trh->accept(j)) )
00295 {
00296 halo1 = true;
00297 haloTriggerAny = true;
00298 }
00299
00300 if( (j == majikNumber2) && (trh->accept(j)) )
00301 {
00302 halo2 = true;
00303 haloTriggerAny = true;
00304 }
00305
00306 if( (j == majikNumber3) && (trh->accept(j)) )
00307 {
00308 halo3 = true;
00309 haloTriggerAny = true;
00310 }
00311 }
00312
00313 float radius = sqrt( vtxArray[2]*vtxArray[2] + vtxArray[3]*vtxArray[3] );
00314
00315 if( vtxArray[1] == 1){
00316 float projX = ((vtxArray[4]/vtxArray[6])*(-1375)) + vtxArray[2];
00317 float projY = ((vtxArray[5]/vtxArray[6])*(-1375)) + vtxArray[3];
00318 float projRad = sqrt(projX*projX + projY*projY);
00319 int radInd = 0;
00320 for(int j=0; j<50; j++)
00321 {
00322 if((projRad >= (j)*15.0) && (projRad < (j+1)*15)) radInd = j;
00323 }
00324 PlusEffDen->Fill(radius);
00325 if(haloTriggerAny == true){
00326 PlusEff->Fill(radius,1);
00327 PlusEffNum->Fill(radius);
00328 if((vtxArray[6] < 10) && (radInd != 0))
00329 {
00330 numCountPlus[radInd]+=1.0;
00331 denCountPlus[radInd]+=1.0;
00332 }
00333 } else {
00334 PlusEff->Fill(radius,0);
00335 if((vtxArray[6] < 50) && (radInd !=0))
00336 {
00337 denCountPlus[radInd]+=1.0;
00338 }
00339 }
00340 }
00341
00342 if( vtxArray[1] == -1){
00343 float projX = ((vtxArray[4]/vtxArray[6])*(1375)) + vtxArray[2];
00344 float projY = ((vtxArray[5]/vtxArray[6])*(1375)) + vtxArray[3];
00345 float projRad = sqrt(projX*projX + projY*projY);
00346 int radInd = 0;
00347 for(int j=0; j<50; j++)
00348 if((projRad >= (j)*15.0) && (projRad < (j+1)*15)) radInd = j;
00349 MinusEffDen->Fill(radius);
00350 if(haloTriggerAny == true){
00351 MinusEff->Fill(radius,1);
00352 if((vtxArray[6] > 50) && (radInd != 0)){
00353 numCountMinus[radInd]+=1.0;
00354 denCountMinus[radInd]+=1.0;
00355 }
00356 MinusEffNum->Fill(radius);
00357 } else {
00358 MinusEff->Fill(radius,0);
00359 if((vtxArray[6] > 10) && (radInd != 0))
00360 {
00361 denCountMinus[radInd]+=1.0;
00362 }
00363 }
00364 }
00365
00367
00369 if( haloTriggerAny == true )
00370 {
00371 float cscHit[9][8];
00372 for(int j = 1; j < 9; j++) cscHit[j][1] = 0;
00373
00374 edm::Handle<CSCRecHit2DCollection> cscRecHits;
00375 e.getByLabel(cscRecHitLabel, cscRecHits);
00376 CSCRecHit2DCollection::const_iterator hit = cscRecHits->begin();
00377 for(; hit != cscRecHits->end(); hit++)
00378 {
00379 LocalPoint p = hit->localPosition();
00380 CSCDetId id((hit)->geographicalId().rawId());
00381 GlobalPoint gP = m_cscGeometry->idToDet(id)->toGlobal(hit->localPosition());
00382 int hitIndex = id.station() + 5*(id.endcap() - 1);
00383 if( cscHit[hitIndex][1] == 0 )
00384 {
00385 cscHit[hitIndex][1] = 1;
00386 cscHit[hitIndex][2] = gP.x();
00387 cscHit[hitIndex][3] = gP.y();
00388 cscHit[hitIndex][4] = gP.z();
00389 cscHit[hitIndex][5] = sqrt( gP.x()*gP.x() + gP.y()*gP.y() );
00390 float joe1 = ((gP.phi()+3.2)*180*100/(3.14));
00391 int joe2 = int(joe1) % 1000;
00392 float joe3 = (1.0*joe2)/100;
00393 cscHit[hitIndex][6] = joe3;
00394 cscHit[hitIndex][7] = gP.eta();
00395 }
00396 }
00397
00399
00401 if(halo0 == true)
00402 {
00403 if(cscHit[1][1] == 1)
00404 {
00405 PlusMe1BeamHaloOcc->Fill(cscHit[1][2],cscHit[1][3]);
00406 PlusMe1BeamHaloOccRad->Fill(cscHit[1][5]);
00407 }
00408 if(cscHit[2][1] == 1) PlusMe2BeamHaloOcc->Fill(cscHit[2][2],cscHit[2][3]);
00409 if(cscHit[3][1] == 1) PlusMe3BeamHaloOcc->Fill(cscHit[3][2],cscHit[3][3]);
00410 if(cscHit[4][1] == 1) PlusMe4BeamHaloOcc->Fill(cscHit[4][2],cscHit[4][3]);
00411 if(cscHit[5][1] == 1)
00412 {
00413 MinusMe1BeamHaloOcc->Fill(cscHit[5][2],cscHit[5][3]);
00414 MinusMe1BeamHaloOccRad->Fill(cscHit[5][5]);
00415 }
00416 if(cscHit[6][1] == 1) MinusMe2BeamHaloOcc->Fill(cscHit[6][2],cscHit[6][3]);
00417 if(cscHit[7][1] == 1) MinusMe3BeamHaloOcc->Fill(cscHit[7][2],cscHit[7][3]);
00418 if(cscHit[8][1] == 1) MinusMe4BeamHaloOcc->Fill(cscHit[8][2],cscHit[8][3]);
00419
00420 }
00421
00422 if(halo1 == true)
00423 {
00424 if(cscHit[1][1] == 1) PlusMe1BeamHaloOccRing1->Fill(cscHit[1][2],cscHit[1][3]);
00425 if(cscHit[2][1] == 1)
00426 {
00427 PlusMe2BeamHaloOccRing1->Fill(cscHit[2][2],cscHit[2][3]);
00428 PlusMe2BeamHaloOccRing1Unfold->Fill(cscHit[2][6],cscHit[2][7]);
00429 }
00430 if(cscHit[3][1] == 1)
00431 {
00432 PlusMe3BeamHaloOccRing1->Fill(cscHit[3][2],cscHit[3][3]);
00433 PlusMe3BeamHaloOccRing1Unfold->Fill(cscHit[3][6],cscHit[3][7]);
00434 }
00435 if(cscHit[4][1] == 1) PlusMe4BeamHaloOccRing1->Fill(cscHit[4][2],cscHit[4][3]);
00436 if(cscHit[5][1] == 1) MinusMe1BeamHaloOccRing1->Fill(cscHit[5][2],cscHit[5][3]);
00437 if(cscHit[6][1] == 1)
00438 {
00439 MinusMe2BeamHaloOccRing1->Fill(cscHit[6][2],cscHit[6][3]);
00440 MinusMe2BeamHaloOccRing1Unfold->Fill(cscHit[6][6],cscHit[6][7]);
00441 }
00442 if(cscHit[7][1] == 1)
00443 {
00444 MinusMe3BeamHaloOccRing1->Fill(cscHit[7][2],cscHit[7][3]);
00445 MinusMe3BeamHaloOccRing1Unfold->Fill(cscHit[7][6],cscHit[7][7]);
00446 }
00447 if(cscHit[8][1] == 1) MinusMe4BeamHaloOccRing1->Fill(cscHit[8][2],cscHit[8][3]);
00448 }
00449
00450 if(halo2 == true)
00451 {
00452 if(cscHit[1][1] == 1) PlusMe1BeamHaloOccRing2->Fill(cscHit[1][2],cscHit[1][3]);
00453 if(cscHit[2][1] == 1)
00454 {
00455 PlusMe2BeamHaloOccRing2->Fill(cscHit[2][2],cscHit[2][3]);
00456 PlusMe2BeamHaloOccRing2Unfold->Fill(cscHit[2][6],cscHit[2][7]);
00457 }
00458 if(cscHit[3][1] == 1)
00459 {
00460 PlusMe3BeamHaloOccRing2->Fill(cscHit[3][2],cscHit[3][3]);
00461 PlusMe3BeamHaloOccRing2Unfold->Fill(cscHit[2][6],cscHit[2][7]);
00462 }
00463 if(cscHit[4][1] == 1) PlusMe4BeamHaloOccRing2->Fill(cscHit[4][2],cscHit[4][3]);
00464 if(cscHit[5][1] == 1) MinusMe1BeamHaloOccRing2->Fill(cscHit[5][2],cscHit[5][3]);
00465 if(cscHit[6][1] == 1)
00466 {
00467 MinusMe2BeamHaloOccRing2->Fill(cscHit[6][2],cscHit[6][3]);
00468 MinusMe2BeamHaloOccRing2Unfold->Fill(cscHit[6][6],cscHit[6][7]);
00469 }
00470 if(cscHit[7][1] == 1)
00471 {
00472 MinusMe3BeamHaloOccRing2->Fill(cscHit[7][2],cscHit[7][3]);
00473 MinusMe3BeamHaloOccRing2Unfold->Fill(cscHit[7][6],cscHit[7][7]);
00474 }
00475 if(cscHit[8][1] == 1) MinusMe4BeamHaloOccRing2->Fill(cscHit[8][2],cscHit[8][3]);
00476 }
00477
00478 if(halo3 == true)
00479 {
00480 if(cscHit[1][1] == 1) PlusMe1BeamHaloOccRing2or3->Fill(cscHit[1][2],cscHit[1][3]);
00481 if(cscHit[2][1] == 1) PlusMe2BeamHaloOccRing2or3->Fill(cscHit[2][2],cscHit[2][3]);
00482 if(cscHit[3][1] == 1) PlusMe3BeamHaloOccRing2or3->Fill(cscHit[3][2],cscHit[3][3]);
00483 if(cscHit[4][1] == 1) PlusMe4BeamHaloOccRing2or3->Fill(cscHit[4][2],cscHit[4][3]);
00484 if(cscHit[5][1] == 1) MinusMe1BeamHaloOccRing2or3->Fill(cscHit[5][2],cscHit[5][3]);
00485 if(cscHit[6][1] == 1) MinusMe2BeamHaloOccRing2or3->Fill(cscHit[6][2],cscHit[6][3]);
00486 if(cscHit[7][1] == 1) MinusMe3BeamHaloOccRing2or3->Fill(cscHit[7][2],cscHit[7][3]);
00487 if(cscHit[8][1] == 1) MinusMe4BeamHaloOccRing2or3->Fill(cscHit[8][2],cscHit[8][3]);
00488 }
00489 }
00490 }
00491 }