00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <memory>
00016
00017
00018 #include "RecoEgamma/Examples/plugins/SiStripElectronAnalyzer.h"
00019
00020 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00021 #include "FWCore/Framework/interface/Event.h"
00022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00023
00024 #include "DataFormats/Math/interface/Point3D.h"
00025 #include "DataFormats/Common/interface/Handle.h"
00026 #include "FWCore/Framework/interface/ESHandle.h"
00027 #include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h"
00028 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00029 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00030 #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
00031 #include "DataFormats/DetId/interface/DetId.h"
00032 #include "DataFormats/EgammaCandidates/interface/Electron.h"
00033 #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
00034 #include "DataFormats/EgammaCandidates/interface/SiStripElectron.h"
00035 #include "DataFormats/EgammaCandidates/interface/SiStripElectronFwd.h"
00036
00037
00038 #include "DataFormats/TrackReco/interface/Track.h"
00039 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
00040 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
00041 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
00042 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h"
00043 #include "Geometry/CommonDetUnit/interface/GeomDetUnit.h"
00044 #include "Geometry/CommonDetUnit/interface/GeomDetType.h"
00045 #include "Geometry/CommonDetUnit/interface/GeomDetEnumerators.h"
00046 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00047 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00048 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00049 #include "DataFormats/SiStripDetId/interface/TIBDetId.h"
00050 #include "DataFormats/SiStripDetId/interface/TOBDetId.h"
00051 #include "DataFormats/SiStripDetId/interface/TIDDetId.h"
00052 #include "DataFormats/SiStripDetId/interface/TECDetId.h"
00053 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
00054 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 SiStripElectronAnalyzer::SiStripElectronAnalyzer(const edm::ParameterSet& iConfig)
00069 {
00070
00071 fileName_ = iConfig.getParameter<std::string>("fileName");
00072
00073 file_ = new TFile(fileName_.c_str(), "RECREATE");
00074 numCand_ = new TH1F("numCandidates", "Number of candidates found", 10, -0.5, 9.5);
00075 numElectrons_ = new TH1F("numElectrons", "Number of Electrons found", 10, -0.5, 9.5);
00076 numSuperClusters_ = new TH1F("numSuperClusters","Number of Ecal SuperClusters", 50, 0, 50);
00077
00078
00079 energySuperClusters_= new TH1F("energySuperClusters","Super Cluster Energy - all ", 200 , 0, 2000.);
00080 energySuperClustersEl_= new TH1F("energySuperClustersEl","Super Cluster Energy - Electron Cands ", 200, 0., 2000.);
00081
00082
00083 sizeSuperClusters_= new TH1F("sizeSuperClusters","Super Cluster Size - all ", 20, 0, 19);
00084 sizeSuperClustersEl_= new TH1F("sizeSuperClustersEl","Super Cluster Size - Electron Cands ", 20, 0, 19);
00085
00086 emaxSuperClusters_= new TH1F("emaxSuperClusters","Super Cluster Emax - all ", 200, 0, 2000.);
00087 emaxSuperClustersEl_= new TH1F("emaxSuperClustersEl","Super Cluster Emax - Electron Cands ", 200, 0, 2000.);
00088
00089 phiWidthSuperClusters_ = new TH1F("phiWidthSuperClusters", "Super Cluster Width - all ",20, 0., 0.05 );
00090 phiWidthSuperClustersEl_ = new TH1F("phiWidthSuperClustersEl", "Super Cluster Width - Electron Cands ", 20 , 0., 0.05 );
00091
00092
00093
00094
00095
00096 ptDiff = new TH1F("ptDiff"," ptDiff ", 20, -10.,10.);
00097 pDiff = new TH1F("pDiff"," pDiff ", 100, -50.,50.);
00098
00099
00100 pElectronFailed = new TH1F("pElectronFailed"," pElectronFailed ", 55, 0.,110.);
00101 ptElectronFailed = new TH1F("ptElectronFailed"," ptElectronFailed ", 55, 0.,110.);
00102
00103
00104 pElectronPassed = new TH1F("pElectronPassed"," pElectronPassed ", 55, 0.,110.);
00105 ptElectronPassed = new TH1F("ptElectronPassed"," ptElectronPassed ", 55, 0.,110.);
00106
00107
00108 sizeSuperClustersFailed= new TH1F("sizeSuperClustersFailed","Super Cluster Size - Failed ", 20, 0, 19);
00109 sizeSuperClustersPassed= new TH1F("sizeSuperClustersPassed","Super Cluster Size - Passed ", 20, 0, 19);
00110
00111
00112 energySuperClustersPassed= new TH1F("energySuperClustersPassed","Super Cluster Energy - Passed ", 125, 0, 250.);
00113 energySuperClustersFailed= new TH1F("energySuperClustersFailed","Super Cluster Energy - Failed ", 125, 0, 250.);
00114
00115
00116 eOverPFailed = new TH1F("eOverPFailed"," E over P - Failed ", 50, 0, 10.) ;
00117 eOverPPassed = new TH1F("eOverPPassed"," E over P - Passed ", 50, 0, 10.) ;
00118
00119
00120
00121
00122 numSiStereoHits_ = new TH1F("numSiStereoHits","Number of Si StereoHits",100,0,1000);
00123 numSiMonoHits_ = new TH1F("numSiMonoHits","Number of Si MonoHits",100,0,1000);
00124 numSiMatchedHits_ = new TH1F("numSiMatchedHits","Number of Si MatchedHits",100,0,1000);
00125
00126
00127
00129
00130
00131
00132 mctruthProducer_ = iConfig.getParameter<std::string>("mctruthProducer");
00133 mctruthCollection_ = iConfig.getParameter<std::string>("mctruthCollection");
00134
00135 superClusterProducer_ = iConfig.getParameter<std::string>("superClusterProducer");
00136 superClusterCollection_ = iConfig.getParameter<std::string>("superClusterCollection");
00137
00138 eBRecHitProducer_ = iConfig.getParameter<std::string>("recHitProducer");
00139 eBRecHitCollection_ = iConfig.getParameter<std::string>("recHitCollection");
00140
00141 siElectronProducer_ = iConfig.getParameter<std::string>("siElectronProducer");
00142 siElectronCollection_ = iConfig.getParameter<std::string>("siElectronCollection");
00143
00144 electronProducer_ = iConfig.getParameter<std::string>("electronProducer");
00145 electronCollection_ = iConfig.getParameter<std::string>("electronCollection");
00146
00147 siHitProducer_ = iConfig.getParameter<std::string>("siHitProducer");
00148 siRphiHitCollection_ = iConfig.getParameter<std::string>("siRphiHitCollection");
00149 siStereoHitCollection_ = iConfig.getParameter<std::string>("siStereoHitCollection");
00150 siMatchedHitCollection_ = iConfig.getParameter<std::string>("siMatchedHitCollection");
00151
00152 }
00153
00154
00155
00156
00157
00158
00159 SiStripElectronAnalyzer::~SiStripElectronAnalyzer()
00160 {
00161
00162
00163
00164
00165 file_->Write();
00166 file_->Close();
00167 }
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185 void SiStripElectronAnalyzer::beginJob(edm::EventSetup const &iSetup){
00186
00187 myTree_ = new TTree("myTree","my first Tree example");
00188
00189 myTree_->Branch("NShowers",&NShowers_,"NShowers/I");
00190
00191
00192
00193
00194 myTree_->Branch("EShower",&EShower_,"EShower[1000]/F");
00195 myTree_->Branch("XShower",&XShower_,"XShower[1000]/F");
00196 myTree_->Branch("YShower",&YShower_,"YShower[1000]/F");
00197 myTree_->Branch("ZShower",&ZShower_,"ZShower[1000]/F");
00198
00199
00200 myTree_->Branch("NStereoHits",&NStereoHits_,"NStereoHits/I");
00201 myTree_->Branch("StereoHitX",&StereoHitX_,"StereoHitX[1000]/F");
00202 myTree_->Branch("StereoHitY",&StereoHitY_,"StereoHitY[1000]/F");
00203 myTree_->Branch("StereoHitZ",&StereoHitZ_,"StereoHitZ[1000]/F");
00204
00205 myTree_->Branch("StereoHitR",&StereoHitR_,"StereoHitR[1000]/F");
00206 myTree_->Branch("StereoHitPhi",&StereoHitPhi_,"StereoHitPhi[1000]/F");
00207 myTree_->Branch("StereoHitTheta",&StereoHitTheta_,"StereoHitTheta[1000]/F");
00208
00209 myTree_->Branch("StereoHitSigX",&StereoHitSigX_,"StereoHitSigX[1000]/F");
00210 myTree_->Branch("StereoHitSigY",&StereoHitSigY_,"StereoHitSigY[1000]/F");
00211 myTree_->Branch("StereoHitCorr",&StereoHitCorr_,"StereoHitCorr[1000]/F");
00212
00213 myTree_->Branch("StereoHitSignal",&StereoHitSignal_,"StereoHitSignal[1000]/F");
00214 myTree_->Branch("StereoHitNoise",&StereoHitNoise_,"StereoHitNoise[1000]/F");
00215 myTree_->Branch("StereoHitWidth",&StereoHitWidth_,"StereoHitWidth[1000]/I");
00216
00217 myTree_->Branch("StereoDetector",&StereoDetector_,"StereoDetector[1000]/I");
00218 myTree_->Branch("StereoLayer",&StereoLayer_,"StereoLayer[1000]/I");
00219
00220
00221
00222 myTree_->Branch("NMonoHits",&NMonoHits_,"NMonoHits/I");
00223 myTree_->Branch("MonoHitX",&MonoHitX_,"MonoHitX[1000]/F");
00224 myTree_->Branch("MonoHitY",&MonoHitY_,"MonoHitY[1000]/F");
00225 myTree_->Branch("MonoHitZ",&MonoHitZ_,"MonoHitZ[1000]/F");
00226
00227
00228 myTree_->Branch("MonoHitR",&MonoHitR_,"MonoHitR[1000]/F");
00229 myTree_->Branch("MonoHitPhi",&MonoHitPhi_,"MonoHitPhi[1000]/F");
00230 myTree_->Branch("MonoHitTheta",&MonoHitTheta_,"MonoHitTheta[1000]/F");
00231
00232 myTree_->Branch("MonoHitSigX",&MonoHitSigX_,"MonoHitSigX[1000]/F");
00233 myTree_->Branch("MonoHitSigY",&MonoHitSigY_,"MonoHitSigY[1000]/F");
00234 myTree_->Branch("MonoHitCorr",&MonoHitCorr_,"MonoHitCorr[1000]/F");
00235
00236 myTree_->Branch("MonoHitSignal",&MonoHitSignal_,"MonoHitSignal[1000]/F");
00237 myTree_->Branch("MonoHitNoise",&MonoHitNoise_,"MonoHitNoise[1000]/F");
00238 myTree_->Branch("MonoHitWidth",&MonoHitWidth_,"MonoHitWidth[1000]/I");
00239
00240 myTree_->Branch("MonoDetector",&MonoDetector_,"MonoDetector[1000]/I");
00241 myTree_->Branch("MonoLayer",&MonoLayer_,"MonoLayer[1000]/I");
00242
00243
00244 myTree_->Branch("NMatchedHits",&NMatchedHits_,"NMatchedHits/I");
00245 myTree_->Branch("MatchedHitX",&MatchedHitX_,"MatchedHitX[1000]/F");
00246 myTree_->Branch("MatchedHitY",&MatchedHitY_,"MatchedHitY[1000]/F");
00247 myTree_->Branch("MatchedHitZ",&MatchedHitZ_,"MatchedHitZ[1000]/F");
00248
00249 myTree_->Branch("MatchedHitR",&MatchedHitR_,"MatchedHitR[1000]/F");
00250 myTree_->Branch("MatchedHitPhi",&MatchedHitPhi_,"MatchedHitPhi[1000]/F");
00251 myTree_->Branch("MatchedHitTheta",&MatchedHitTheta_,"MatchedHitTheta[1000]/F");
00252
00253 myTree_->Branch("MatchedHitSigX",&MatchedHitSigX_,"MatchedHitSigX[1000]/F");
00254 myTree_->Branch("MatchedHitSigY",&MatchedHitSigY_,"MatchedHitSigY[1000]/F");
00255 myTree_->Branch("MatchedHitCorr",&MatchedHitCorr_,"MatchedHitCorr[1000]/F");
00256
00257 myTree_->Branch("MatchedHitSignal",&MatchedHitSignal_,"MatchedHitSignal[1000]/F");
00258 myTree_->Branch("MatchedHitNoise",&MatchedHitNoise_,"MatchedHitNoise[1000]/F");
00259 myTree_->Branch("MatchedHitWidth",&MatchedHitWidth_,"MatchedHitWidth[1000]/I");
00260
00261 myTree_->Branch("MatchedDetector",&MatchedDetector_,"MatchedDetector[1000]/I");
00262 myTree_->Branch("MatchedLayer",&MatchedLayer_,"MatchedLayer[1000]/I");
00263
00264 }
00265
00266 void SiStripElectronAnalyzer::initNtuple(){
00267
00268 LogDebug("") << " In initNtuple " ;
00269
00270 NShowers_ = -999 ;
00271 for (int init = 0 ; init < myMaxHits ; ++init){
00272 EShower_[init] = -999.;
00273 XShower_[init] = -999.;
00274 YShower_[init] = -999.;
00275 ZShower_[init] = -999.;
00276 }
00277 NStereoHits_ = -999 ;
00278
00279 for (int init = 0 ; init < myMaxHits ; ++init){
00280 StereoHitX_[init] = -999.;
00281 StereoHitY_[init] = -999.;
00282 StereoHitZ_[init] = -999.;
00283 StereoHitR_[init] = -999.;
00284 StereoHitPhi_[init] = -999.;
00285 StereoHitTheta_[init] = -999.;
00286
00287 StereoHitSignal_[init] = -999.;
00288 StereoHitNoise_[init] = -999.;
00289 StereoHitWidth_[init] = -999 ;;
00290 }
00291
00292 NMonoHits_ = -999 ;
00293 for (int init = 0 ; init < myMaxHits ; ++init){
00294 MonoHitX_[init] = -999.;
00295 MonoHitY_[init] = -999.;
00296 MonoHitZ_[init] = -999.;
00297 MonoHitR_[init] = -999.;
00298 MonoHitPhi_[init] = -999.;
00299 MonoHitTheta_[init] = -999.;
00300
00301 MonoHitSignal_[init] = -999.;
00302 MonoHitNoise_[init] = -999.;
00303 MonoHitWidth_[init] = -999 ;;
00304 }
00305
00306 NMatchedHits_ = -999 ;
00307 for (int init = 0 ; init < myMaxHits ; ++init){
00308 MatchedHitX_[init] = -999.;
00309 MatchedHitY_[init] = -999.;
00310 MatchedHitZ_[init] = -999.;
00311 MatchedHitR_[init] = -999.;
00312 MatchedHitPhi_[init] = -999.;
00313 MatchedHitTheta_[init] = -999.;
00314
00315 MatchedHitSignal_[init] = -999.;
00316 MatchedHitNoise_[init] = -999.;
00317 MatchedHitWidth_[init] = -999 ;;
00318 }
00319
00320
00321
00322 }
00323
00324
00325 void
00326 SiStripElectronAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00327 {
00328 using namespace std;
00329
00330 initNtuple();
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353 edm::Handle<EcalRecHitCollection> pRecHits;
00354 iEvent.getByLabel(eBRecHitProducer_, eBRecHitCollection_, pRecHits);
00355
00356
00357
00358
00359
00360 edm::Handle<reco::SuperClusterCollection> clusterHandle;
00361 iEvent.getByLabel(superClusterProducer_, superClusterCollection_, clusterHandle);
00362
00363
00366
00367 LogDebug("") << " Start loop over "
00368 << clusterHandle->end()-clusterHandle->begin()
00369 << " superClusters " ;
00370
00371 for (reco::SuperClusterCollection::const_iterator clusterIter = clusterHandle->begin();
00372 clusterIter != clusterHandle->end();
00373 ++clusterIter) {
00374 double energy = clusterIter->energy();
00375 math::XYZPoint position = clusterIter->position();
00376 std::ostringstream str;
00377
00378 str << " SuperCluster " << energy << " GeV, position "
00379 << position << " cm" << "\n" ;
00380
00381 energySuperClusters_->Fill(energy);
00382 sizeSuperClusters_->Fill(clusterIter->clustersSize());
00383
00384
00385
00386
00387 str << "About to loop over basicClusters" << "\n" ;
00388
00389 double emaxSuperCluster = 0. ;
00390 double phibar = 0. ;
00391 double phi2bar = 0. ;
00392 double eTotSuperCluster = 0. ;
00393
00394
00395
00396 for (reco::basicCluster_iterator basicClusterIter = clusterIter->clustersBegin() ;
00397 basicClusterIter != clusterIter->clustersEnd() ;
00398 ++basicClusterIter ){
00399
00400 std::vector<DetId> theIds= (*basicClusterIter)->getHitsByDetId();
00401
00402 str << " basicCluster Energy " << (*basicClusterIter)->energy()
00403 << " Position " << (*basicClusterIter)->position()
00404 << " \n"
00405 << " Position phi " << (*basicClusterIter)->position().phi()
00406 << " recHits " << theIds.size()
00407 << " \n" ;
00408
00409 double eCluster = (*basicClusterIter)->energy();
00410 if(eCluster > emaxSuperCluster ){
00411 emaxSuperCluster = eCluster ;
00412 }
00413 eTotSuperCluster += eCluster ;
00414 double phiCluster = (*basicClusterIter)->position().phi() ;
00415 phibar += eCluster * phiCluster ;
00416 phi2bar += eCluster * phiCluster * phiCluster ;
00417
00418
00419 }
00420
00421
00422
00423 phibar= phibar /eTotSuperCluster ;
00424 phi2bar= phi2bar /eTotSuperCluster ;
00425 double phiWidth = phi2bar - phibar*phibar ;
00426 if(phiWidth>0.) {
00427 phiWidth = pow(phiWidth,0.5);
00428 }else{
00429 phiWidth =0.;
00430 }
00431 str << " SuperCluster stats " << "\n" ;
00432 str << "phibar " << phibar
00433 << " phi2bar " << phi2bar
00434 << " eTotSuperCluster " << eTotSuperCluster
00435 << " phiWidth " << phiWidth
00436 << std::endl ;
00437
00438 phiWidthSuperClusters_->Fill(phiWidth);
00439
00440 emaxSuperClusters_->Fill(emaxSuperCluster);
00441
00442 str << " Done with this SuperCluster " << std::endl;
00443
00444 LogDebug("") << str.str() ;
00445
00446 }
00447
00448 LogDebug("") << " End loop over superClusters ";
00449
00452
00453
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00467
00468
00469
00470
00471
00472 edm::Handle<reco::SiStripElectronCollection> siStripElectronHandle;
00473 iEvent.getByLabel(siElectronProducer_, siElectronCollection_, siStripElectronHandle);
00474
00475
00476
00478
00479
00480 LogDebug("") << " Dumping Algo's guess of SiStripElectron Candidate Info " ;
00481 int numberOfElectrons = 0;
00482
00483 LogDebug("") << " Number of SiStripElectrons " << siStripElectronHandle->size() ;
00484
00485
00486 for (reco::SiStripElectronCollection::const_iterator electronIter = siStripElectronHandle->begin();
00487 electronIter != siStripElectronHandle->end(); ++electronIter) {
00488
00489
00490 LogDebug("") << "about to get stuff from electroncandidate "
00491 << numberOfElectrons << "\n"
00492 << "supercluster energy = "
00493 << electronIter->superCluster()->energy() << "\n"
00494 << "fit results are phi(r) = "
00495 << electronIter->phiAtOrigin() << " + "
00496 << electronIter->phiVsRSlope() << "*r" << "\n"
00497 << " chi2 " << electronIter->chi2()
00498 << " ndof " << electronIter->ndof() << "\n"
00499 << " Pt " << electronIter->pt() << "\n"
00500 << "P, Px, Py, Pz "
00501 << electronIter->p() << " "
00502 << electronIter->px() << " "
00503 << electronIter->py() << " "
00504 << electronIter->pz() << "\n"
00505 << "you get the idea..." ;
00506
00507
00508 energySuperClustersEl_->Fill(electronIter->superCluster()->energy());
00509 sizeSuperClustersEl_->Fill(electronIter->superCluster()->clustersSize());
00510
00511
00512 double emaxSuperCluster = 0. ;
00513 double phibar = 0. ;
00514 double phi2bar = 0. ;
00515 double eTotSuperCluster = 0. ;
00516
00517 for (reco::basicCluster_iterator basicClusterIter = electronIter->superCluster()->clustersBegin() ;
00518 basicClusterIter != electronIter->superCluster()->clustersEnd() ;
00519 ++basicClusterIter ){
00520
00521 std::vector<DetId> theIds= (*basicClusterIter)->getHitsByDetId();
00522
00523 double eCluster = (*basicClusterIter)->energy();
00524 if(eCluster > emaxSuperCluster ){
00525 emaxSuperCluster = eCluster ;
00526 }
00527 eTotSuperCluster += eCluster ;
00528 double phiCluster = (*basicClusterIter)->position().phi() ;
00529 phibar += eCluster * phiCluster ;
00530 phi2bar += eCluster * phiCluster * phiCluster ;
00531
00532 }
00533
00534 phibar=phibar/eTotSuperCluster ;
00535 phi2bar=phi2bar/eTotSuperCluster ;
00536 double phiWidth = phi2bar - phibar*phibar ;
00537 if(phiWidth>0.) {
00538 phiWidth = pow(phiWidth,0.5);
00539 }else{
00540 phiWidth =0.;
00541 }
00542
00543 phiWidthSuperClustersEl_->Fill(phiWidth);
00544
00545 emaxSuperClustersEl_->Fill(emaxSuperCluster);
00546
00547 numberOfElectrons++;
00548 }
00549
00550 numCand_->Fill(siStripElectronHandle->size());
00551
00553
00554
00555
00556
00557
00558 LogDebug("")<< " About to check Electrons" ;
00559
00560 edm::Handle<reco::ElectronCollection> electrons ;
00561 iEvent.getByLabel(electronProducer_, electronCollection_, electrons);
00562
00563 numElectrons_->Fill(electrons->end()- electrons->begin());
00564
00565
00566
00567
00568 bool* hasElectron_ = new bool[siStripElectronHandle->end()- siStripElectronHandle->begin()] ;
00569 for (int icount = 0 ;
00570 icount < siStripElectronHandle->end()- siStripElectronHandle->begin() ;
00571 ++icount)
00572 { hasElectron_[icount] = false ;}
00573
00574
00575
00576
00577 unsigned int* Electron_to_strippy = new unsigned int[electrons->end()- electrons->begin()];
00578 for (int icount = 0 ;
00579 icount <electrons->end()- electrons->begin(); ++icount)
00580 { Electron_to_strippy[icount] = 0 ;}
00581
00582 unsigned int ecount=0 ;
00583 for (reco::ElectronCollection::const_iterator electronIter = electrons->begin();
00584 electronIter != electrons->end(); ++electronIter ){
00585
00586
00587 LogDebug("")<< " Associating Electrons to Strippies " ;
00588 LogDebug("")<< " PT is " << electronIter->track()->pt() ;
00589
00590 reco::TrackRef tr =(*electronIter).track();
00591 uint32_t id = (*electronIter->track()->recHitsBegin())->geographicalId().rawId();
00592 LocalPoint pos = (*electronIter->track()->recHitsBegin())->localPosition();
00593
00594 unsigned int icount = 0 ;
00595 LogDebug("") << " About to loop over Strippies " << " \n "
00596 << " icount " << icount
00597 << " max " << siStripElectronHandle->end()- siStripElectronHandle->begin() ;
00598
00599 for (reco::SiStripElectronCollection::const_iterator strippyiter = siStripElectronHandle->begin();
00600 strippyiter != siStripElectronHandle->end(); ++strippyiter) {
00601
00602 bool hitInCommon = false;
00603
00604 for (edm::RefVector<SiStripRecHit2DCollection>::const_iterator
00605 hiter = strippyiter->rphiRecHits().begin();
00606 hiter != strippyiter->rphiRecHits().end();
00607 ++hiter) {
00608 if ((*hiter)->geographicalId().rawId() == id &&
00609 ((*hiter)->localPosition() - pos).mag() < 1e-10) {
00610 hitInCommon = true;
00611 break;
00612 }
00613 }
00614
00615 for (edm::RefVector<SiStripRecHit2DCollection>::const_iterator
00616 hiter = strippyiter->stereoRecHits().begin();
00617 hiter != strippyiter->stereoRecHits().end();
00618 ++hiter) {
00619 if ((*hiter)->geographicalId().rawId() == id &&
00620 ((*hiter)->localPosition() - pos).mag() < 1e-10) {
00621 hitInCommon = true;
00622 break;
00623 }
00624 }
00625 if (hitInCommon) {
00626 hasElectron_[icount] = true ;
00627 Electron_to_strippy[ecount]= icount ;
00628 ptDiff->Fill( fabs(electronIter->track()->pt()) - fabs(strippyiter->pt()) );
00629 pDiff->Fill( fabs(electronIter->track()->p()) - fabs(strippyiter->p()) );
00630
00631 }
00632 icount++ ;
00633 }
00634 ecount++;
00635 }
00636
00637 LogDebug("") << " Done looping over Electrons " ;
00638
00639
00640 unsigned int counter = 0 ;
00641 for (reco::SiStripElectronCollection::const_iterator strippyIter = siStripElectronHandle->begin(); strippyIter != siStripElectronHandle->end(); ++strippyIter) {
00642
00643
00644 bool skipThis = !hasElectron_[counter] ;
00645 if( skipThis ) {
00646
00647
00648 LogDebug("") << " SiStrip Failed Electron " << " \n " <<
00649 " p " << strippyIter->p() << " \n " <<
00650 " pt " << strippyIter->pt() << " \n " <<
00651 " SuperClust size " << strippyIter->superCluster()->clustersSize() ;
00652
00653 pElectronFailed->Fill( fabs(strippyIter->p()) );
00654 ptElectronFailed->Fill( fabs(strippyIter->pt()) );
00655 sizeSuperClustersFailed->Fill(strippyIter->superCluster()->clustersSize());
00656 LogDebug("") << " done filling Failed histos " ;
00657
00658
00659
00660
00661
00662
00663
00664 } else {
00665 LogDebug("") << " SiStrip Passed Electron " << " \n " <<
00666 " p " << strippyIter->p() << " \n " <<
00667 " pt " << strippyIter->pt() << " \n " <<
00668 " SuperClust size " << strippyIter->superCluster()->clustersSize() ;
00669 pElectronPassed->Fill( fabs(strippyIter->p()) );
00670 ptElectronPassed->Fill( fabs(strippyIter->pt()) );
00671 sizeSuperClustersPassed->Fill(strippyIter->superCluster()->clustersSize());
00672 LogDebug("") << " done filling passed histos " ;
00673
00674
00675
00676
00677
00678
00679
00680 }
00681 counter++;
00682 }
00683
00684 LogDebug("")<< "Dump info for all electrons ";
00685
00686 for (reco::ElectronCollection::const_iterator electronIter1 = electrons->begin();
00687 electronIter1 != electrons->end(); ++electronIter1 ){
00688 reco::TrackRef tr1 =(*electronIter1).track();
00689
00690 unsigned int ecount1= electronIter1-electrons->begin() ;
00691 unsigned int stripCount1 = 0 ;
00692 reco::SiStripElectronCollection::const_iterator strippyIter1 ;
00693 for (reco::SiStripElectronCollection::const_iterator strippyIter = siStripElectronHandle->begin();
00694 strippyIter != siStripElectronHandle->end(); ++strippyIter) {
00695 if(Electron_to_strippy[ecount1]==stripCount1 ) {
00696 strippyIter1 = strippyIter ;
00697 break ; }
00698 stripCount1++ ;
00699 }
00700 ecount1++;
00701
00702 std::ostringstream str;
00703
00704
00705 str << " SiStripElect p , px, py, pz " << strippyIter1->p()
00706 << " " << strippyIter1->px()
00707 << " " << strippyIter1->py()
00708 << " " << strippyIter1->pz()
00709 << "\n " << std::endl ;
00710
00711
00712 str << " Electron p px, py, pz, = " << tr1->p()
00713 << " " << tr1->px()
00714 << " " << tr1->py()
00715 << " " << tr1->pz()
00716 << "\n" << std::endl ;
00717
00718
00719 double EClust1 = strippyIter1->superCluster()->energy() ;
00720 double XClust1 = strippyIter1->superCluster()->x();
00721 double YClust1 = strippyIter1->superCluster()->y();
00722 double ZClust1 = strippyIter1->superCluster()->z();
00723
00724 double rho1 = sqrt(XClust1*XClust1+YClust1*YClust1+ZClust1*ZClust1) ;
00725 double costheta1 = ZClust1/rho1 ;
00726 double sintheta1 = sqrt(1-costheta1*costheta1);
00727 if(ZClust1<0 ) { sintheta1 = - sintheta1 ; }
00728 double cosphi1 = XClust1/sqrt(XClust1*XClust1+YClust1*YClust1);
00729 double sinphi1 = YClust1/sqrt(XClust1*XClust1+YClust1*YClust1);
00730
00731 str << " Ecal for electron E, px, py, pz "
00732 << EClust1 << " "
00733 << EClust1*sintheta1*cosphi1 << " "
00734 << EClust1*sintheta1*sinphi1 << " "
00735 << EClust1*costheta1
00736 << "\n" << std::endl ;
00737
00738 LogDebug("") << str.str() ;
00739
00740 }
00741 LogDebug("")<< "Done Dumping info for all electrons ";
00742
00744
00745
00746
00748 if(electrons->end()-electrons->begin()> 1) {
00749 edm::LogInfo("") << " Two electrons in this event " << std::endl;
00750 for (reco::ElectronCollection::const_iterator electronIter1 = electrons->begin();
00751 electronIter1 != electrons->end()-1; ++electronIter1 ){
00752 reco::TrackRef tr1 =(*electronIter1).track();
00753
00754
00755
00756 unsigned int ecount1= electronIter1-electrons->begin() ;
00757
00758 unsigned int stripCount1 = 0 ;
00759 reco::SiStripElectronCollection::const_iterator strippyIter1 ;
00760 for (reco::SiStripElectronCollection::const_iterator strippyIter = siStripElectronHandle->begin(); strippyIter != siStripElectronHandle->end(); ++strippyIter) {
00761 if(Electron_to_strippy[ecount1]==stripCount1 ) {
00762 strippyIter1 = strippyIter ;
00763 break ; }
00764 stripCount1++ ;
00765 }
00766
00767 double EClust1 = strippyIter1->superCluster()->energy() ;
00768 double XClust1 = strippyIter1->superCluster()->x();
00769 double YClust1 = strippyIter1->superCluster()->y();
00770 double ZClust1 = strippyIter1->superCluster()->z();
00771
00772 for (reco::ElectronCollection::const_iterator electronIter2 = electronIter1+1;
00773 electronIter2 != electrons->end(); ++electronIter2 ){
00774
00775 reco::TrackRef tr2 =(*electronIter2).track();
00776
00777 unsigned int ecount2= electronIter2-electrons->begin() ;
00778 unsigned int stripCount2 = 0 ;
00779 reco::SiStripElectronCollection::const_iterator strippyIter2 ;
00780 for (reco::SiStripElectronCollection::const_iterator strippyIter = siStripElectronHandle->begin(); strippyIter != siStripElectronHandle->end(); ++strippyIter) {
00781 if(Electron_to_strippy[ecount2]==stripCount2 ) {
00782 strippyIter2 = strippyIter ;
00783 break ; }
00784 stripCount2++ ;
00785 }
00786
00787
00788
00789 double EClust2 = strippyIter2->superCluster()->energy() ;
00790 double XClust2 = strippyIter2->superCluster()->x();
00791 double YClust2 = strippyIter2->superCluster()->y();
00792 double ZClust2 = strippyIter2->superCluster()->z();
00793
00794
00795
00796
00797
00798 edm::LogInfo("") << " Electron p1 = " << tr1->p()
00799 << " p1x " << tr1->px()
00800 << " p1y " << tr1->py()
00801 << " p1z " << tr1->pz()
00802 << std::endl ;
00803
00804
00805 edm::LogInfo("") << " Electron p2 = " << tr2->p()
00806 << " p2x " << tr2->px()
00807 << " p2y " << tr2->py()
00808 << " p2z " << tr2->pz()
00809 << std::endl ;
00810
00811
00812
00813 double Zpx = tr1->px()+tr2->px() ;
00814 double Zpy = tr1->py()+tr2->py() ;
00815 double Zpz = tr1->pz()+tr2->pz() ;
00816 double Ze = fabs(tr1->p())+fabs(tr2->p()) ;
00817 edm::LogInfo("") << " Z mass " <<
00818 sqrt(Ze*Ze-Zpx*Zpx-Zpy*Zpy-Zpz*Zpz) << std::endl ;
00819
00820
00821 double rho1 = sqrt(XClust1*XClust1+YClust1*YClust1+ZClust1*ZClust1) ;
00822 double costheta1 = ZClust1/rho1 ;
00823 double sintheta1 = sqrt(1-costheta1*costheta1);
00824 if(ZClust1<0 ) { sintheta1 = - sintheta1 ; }
00825 double cosphi1 = XClust1/sqrt(XClust1*XClust1+YClust1*YClust1);
00826 double sinphi1 = YClust1/sqrt(XClust1*XClust1+YClust1*YClust1);
00827
00828 double rho2 = sqrt(XClust2*XClust2+YClust2*YClust2+ZClust2*ZClust2) ;
00829 double costheta2 = ZClust2/rho2 ;
00830 double sintheta2 = sqrt(1-costheta2*costheta2);
00831 if(ZClust2<0 ) { sintheta2 = - sintheta2 ; }
00832 double cosphi2 = XClust2/sqrt(XClust2*XClust2+YClust2*YClust2);
00833 double sinphi2 = YClust2/sqrt(XClust2*XClust2+YClust2*YClust2);
00834
00835 edm::LogInfo("") << "Energy of supercluster for 1st electron "
00836 << EClust1 << " "
00837 << EClust1*sintheta1*cosphi1 << " "
00838 << EClust1*sintheta1*sinphi1 << " "
00839 << EClust1*costheta1 << " "
00840 << std::endl ;
00841
00842 edm::LogInfo("") << "Energy of supercluster for 2nd electron "
00843 << EClust2 << " "
00844 << EClust2*sintheta2*cosphi2 << " "
00845 << EClust2*sintheta2*sinphi2 << " "
00846 << EClust2*costheta2 << " "
00847 << std::endl ;
00848
00849
00850
00851 double Zgpx = EClust1*sintheta1*cosphi1+EClust2*sintheta2*cosphi2 ;
00852 double Zgpy = EClust1*sintheta1*sinphi1+EClust2*sintheta2*sinphi2 ;
00853 double Zgpz = EClust1*costheta1+EClust2*costheta2 ;
00854 double ZgE = EClust1+EClust2 ;
00855
00856 edm::LogInfo("") << " Z mass from ECAL " <<
00857 sqrt(ZgE*ZgE-Zgpx*Zgpx-Zgpy*Zgpy-Zgpz*Zgpz) << std::endl ;
00858
00859
00860 }
00861 }
00862 }
00863
00864 delete[] hasElectron_;
00865 delete[] Electron_to_strippy;
00866
00870 LogDebug("") << " About to dump tracker info " ;
00871
00872 edm::ESHandle<TrackerGeometry> trackerHandle;
00873 iSetup.get<TrackerDigiGeometryRecord>().get(trackerHandle);
00874
00875 edm::Handle<SiStripRecHit2DCollection> rphiHitsHandle;
00876 iEvent.getByLabel(siHitProducer_, siRphiHitCollection_, rphiHitsHandle);
00877
00878 edm::Handle<SiStripRecHit2DCollection> stereoHitsHandle;
00879 iEvent.getByLabel(siHitProducer_, siStereoHitCollection_, stereoHitsHandle);
00880
00881 edm::Handle<SiStripMatchedRecHit2DCollection> matchedHitsHandle;
00882 iEvent.getByLabel(siHitProducer_, siMatchedHitCollection_, matchedHitsHandle);
00883
00884
00885 const std::vector<DetId> idstereo = stereoHitsHandle->ids();
00886
00887
00889
00891 NShowers_=0 ;
00892 for (reco::SuperClusterCollection::const_iterator clusterIter = clusterHandle->begin();
00893 clusterIter != clusterHandle->end();
00894 ++clusterIter) {
00895 double energy = clusterIter->energy();
00896 math::XYZPoint position = clusterIter->position();
00897 if(NShowers_ < myMaxHits ) {
00898 EShower_[NShowers_] = energy ;
00899 XShower_[NShowers_] = position.x() ;
00900 YShower_[NShowers_] = position.y() ;
00901 ZShower_[NShowers_] = position.z() ;
00902 ++NShowers_ ;
00903 }
00904
00905
00906
00907
00908 }
00909 numSuperClusters_->Fill(NShowers_);
00911
00912
00913 LogDebug("") << " Looping over stereo hits " ;
00914
00916 int myHits = 0 ;
00917 for (std::vector<DetId>::const_iterator id = idstereo.begin(); id != idstereo.end(); ++id) {
00918
00919 SiStripRecHit2DCollection::range hits = stereoHitsHandle->get(*id);
00920 for (SiStripRecHit2DCollection::const_iterator hit = hits.first; hit != hits.second; ++hit) {
00921 if( (hit->geographicalId()).subdetId() == StripSubdetector::TIB ||
00922 (hit->geographicalId()).subdetId() == StripSubdetector::TOB ) {
00923 GlobalPoint position = trackerHandle->idToDet(hit->geographicalId())->surface().toGlobal(hit->localPosition());
00924
00925
00926 SiStripRecHit2D const rechit = *hit ;
00927
00928 LocalError myerror = rechit.localPositionError();
00929
00930
00931
00932 Int_t siLayerNum = 0 ;
00933 Int_t siDetNum = 0 ;
00934 string siDetName = "" ;
00935 if( (hit->geographicalId()).subdetId() == StripSubdetector::TIB ){
00936
00937 siLayerNum = TIBDetId(*id).layer();
00938 siDetNum = 1 ;
00939 siDetName = "TIB" ;
00940 } else if ( (hit->geographicalId()).subdetId() == StripSubdetector::TOB ){
00941 siLayerNum = TOBDetId(*id).layer();
00942 siDetNum = 2 ;
00943 siDetName = "TOB" ;
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954 }else {
00955 siLayerNum = -999 ;
00956 siDetNum = -999 ;
00957 siDetName = "NULL" ;
00958 }
00959
00960
00961 const SiStripRecHit2D::ClusterRef & clust=rechit.cluster();
00962 double Signal = 0 ;
00963 double Noise2 = 0 ;
00964 int StripCount = 0 ;
00965 if(clust.isNonnull()) {
00966
00967
00968 const std::vector<uint8_t> amplitudes=clust->amplitudes();
00969 for(size_t i = 0 ; i<amplitudes.size(); i++ ){
00970 Signal +=amplitudes[i] ;
00971
00972 StripCount++;
00973 }
00974 } else {
00975 LogDebug("") << " null cluster " ;
00976 }
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990 if( myHits < myMaxHits ) {
00991 StereoHitX_[myHits] = position.x();
00992 StereoHitY_[myHits] = position.y();
00993 StereoHitZ_[myHits] = position.z();
00994
00995 StereoHitR_[myHits]=position.perp();
00996 StereoHitPhi_[myHits]=position.phi();
00997 StereoHitTheta_[myHits]=position.theta();
00998
00999 StereoHitSigX_[myHits]=sqrt(myerror.xx());
01000 StereoHitSigY_[myHits]=sqrt(myerror.yy());
01001 StereoHitCorr_[myHits]=myerror.xy()/sqrt(myerror.xx()*myerror.yy());
01002
01003 StereoHitSignal_[myHits] = Signal ;
01004 StereoHitNoise_[myHits] = Noise2 ;
01005 StereoHitWidth_[myHits] = StripCount ;
01006
01007 StereoDetector_[myHits] = siDetNum ;
01008 StereoLayer_[myHits] = siLayerNum ;
01009
01010 ++myHits ;
01011 }
01012 }
01013 }
01014 }
01015 NStereoHits_ = myHits ;
01016
01017 numSiStereoHits_->Fill(NStereoHits_);
01018
01021
01022 LogDebug("") << " Looping over Mono Hits " ;
01024 const std::vector<DetId> idmono = rphiHitsHandle->ids();
01025 myHits = 0 ;
01026 for (std::vector<DetId>::const_iterator id = idmono.begin();
01027 id != idmono.end(); ++id) {
01028
01029
01030 SiStripRecHit2DCollection::range hits = rphiHitsHandle->get(*id);
01031
01032
01033 for (SiStripRecHit2DCollection::const_iterator hit = hits.first; hit != hits.second; ++hit) {
01034
01035 if ((hit->geographicalId()).subdetId() == StripSubdetector::TIB ||
01036 (hit->geographicalId()).subdetId() == StripSubdetector::TOB) {
01037
01038 GlobalPoint position = trackerHandle->idToDet(hit->geographicalId())->surface().toGlobal(hit->localPosition());
01039
01040
01041 SiStripRecHit2D const rechit = *hit ;
01042
01043 LocalError myerror = rechit.localPositionError();
01044
01045
01046
01047 Int_t siLayerNum = 0 ;
01048 Int_t siDetNum = 0 ;
01049 string siDetName = "" ;
01050 if( (hit->geographicalId()).subdetId() == StripSubdetector::TIB ){
01051
01052 siLayerNum = TIBDetId(*id).layer();
01053 siDetNum = 1 ;
01054 siDetName = "TIB" ;
01055 } else if ( (hit->geographicalId()).subdetId() == StripSubdetector::TOB ){
01056 siLayerNum = TOBDetId(*id).layer();
01057 siDetNum = 2 ;
01058 siDetName = "TOB" ;
01059
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069 ;
01070 }else {
01071 siLayerNum = -999 ;
01072 siDetNum = -999 ;
01073 siDetName = "NULL" ;
01074 }
01075
01076 const SiStripRecHit2D::ClusterRef & clust=rechit.cluster();
01077 double Signal = 0 ;
01078 double Noise2 = 0 ;
01079 int StripCount = 0 ;
01080 if(clust.isNonnull()) {
01081
01082
01083 const std::vector<uint8_t> amplitudes=clust->amplitudes();
01084 for(size_t i = 0 ; i<amplitudes.size(); i++ ){
01085 Signal +=amplitudes[i] ;
01086
01087 StripCount++;
01088 }
01089 } else {
01090 LogDebug("") << " null cluster " ;
01091 }
01092
01093
01094
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105 if( myHits < myMaxHits ) {
01106 MonoHitX_[myHits] = position.x();
01107 MonoHitY_[myHits] = position.y();
01108 MonoHitZ_[myHits] = position.z();
01109
01110 MonoHitR_[myHits]=position.perp();
01111 MonoHitPhi_[myHits]=position.phi();
01112 MonoHitTheta_[myHits]=position.theta();
01113
01114 MonoHitSigX_[myHits]=sqrt(myerror.xx());
01115 MonoHitSigY_[myHits]=sqrt(myerror.yy());
01116 MonoHitCorr_[myHits]=myerror.xy()/sqrt(myerror.xx()*myerror.yy());
01117
01118
01119 MonoHitSignal_[myHits] = Signal ;
01120 MonoHitNoise_[myHits] = Noise2 ;
01121 MonoHitWidth_[myHits] = StripCount ;
01122
01123 MonoDetector_[myHits] = siDetNum ;
01124 MonoLayer_[myHits] = siLayerNum ;
01125
01126 ++myHits ;
01127 }
01128
01129 }
01130
01131 }
01132
01133 }
01134
01135 NMonoHits_ = myHits ;
01136
01137 numSiMonoHits_->Fill(NMonoHits_);
01138
01139
01142
01143 LogDebug("") << " Loop over Matched Hits " ;
01144
01146 const std::vector<DetId> idmatched = matchedHitsHandle->ids();
01147 myHits = 0 ;
01148 for (std::vector<DetId>::const_iterator id = idmatched.begin(); id != idmatched.end(); ++id) {
01149
01150
01151 SiStripMatchedRecHit2DCollection::range hits = matchedHitsHandle->get(*id);
01152
01153 for (SiStripMatchedRecHit2DCollection::const_iterator hit = hits.first;
01154 hit != hits.second; ++hit) {
01155 if ((hit->geographicalId()).subdetId() == StripSubdetector::TIB ||
01156 (hit->geographicalId()).subdetId() == StripSubdetector::TOB ) {
01157 GlobalPoint position = trackerHandle->idToDet(hit->geographicalId())->surface().toGlobal(hit->localPosition());
01158 SiStripMatchedRecHit2D const rechit = *hit ;
01159
01160 LocalError myerror = rechit.localPositionError();
01161
01162
01163
01164 Int_t siLayerNum = 0 ;
01165 Int_t siDetNum = 0 ;
01166 string siDetName = "" ;
01167 if( (hit->geographicalId()).subdetId() == StripSubdetector::TIB ){
01168 siLayerNum = TIBDetId(*id).layer();
01169 siDetNum = 1 ;
01170 siDetName = "TIB" ;
01171 } else if ( (hit->geographicalId()).subdetId() == StripSubdetector::TOB ){
01172 siLayerNum = TOBDetId(*id).layer();
01173 siDetNum = 2 ;
01174 siDetName = "TOB" ;
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185 }else {
01186 siLayerNum = -999 ;
01187 siDetNum = -999 ;
01188 siDetName = "NULL" ;
01189 }
01190
01191 double Signal = 0 ;
01192 double Noise2 = 0 ;
01193 int StripCount = 0 ;
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218 if( myHits < myMaxHits ) {
01219 MatchedHitX_[myHits] = position.x();
01220 MatchedHitY_[myHits] = position.y();
01221 MatchedHitZ_[myHits] = position.z();
01222
01223
01224 MatchedHitR_[myHits]=position.perp();
01225 MatchedHitPhi_[myHits]=position.phi();
01226 MatchedHitTheta_[myHits]=position.theta();
01227
01228 MatchedHitSigX_[myHits]=sqrt(myerror.xx());
01229 MatchedHitSigY_[myHits]=sqrt(myerror.yy());
01230 MatchedHitCorr_[myHits]=myerror.xy()/sqrt(myerror.xx()*myerror.yy());
01231
01232
01233
01234 MatchedHitSignal_[myHits] = Signal ;
01235 MatchedHitNoise_[myHits] = Noise2 ;
01236 MatchedHitWidth_[myHits] = StripCount ;
01237
01238 MatchedDetector_[myHits] = siDetNum ;
01239 MatchedLayer_[myHits] = siLayerNum ;
01240
01241 ++myHits ;
01242 }
01243 }
01244 }
01245 }
01246 NMatchedHits_ = myHits ;
01247
01248 numSiMatchedHits_->Fill(NMatchedHits_);
01249
01251
01252
01253
01256 LogDebug("") << "Writing to myTree with " << NShowers_ << " Showers "
01257 << NStereoHits_ << " Si StereoHits "
01258 << NMonoHits_ << " Si MonoHits "
01259 << NMatchedHits_ << " Si MatchedHits " ;
01260
01261 myTree_->Fill();
01262
01263
01264
01265
01266
01267 }
01268
01269
01270 void SiStripElectronAnalyzer::endJob(){
01271 LogDebug("") << "Entering endJob " ;
01272 file_->cd() ;
01273 numCand_->Write();
01274 numElectrons_->Write();
01275 numSuperClusters_->Write();
01276
01277 energySuperClusters_->Write();
01278 sizeSuperClusters_->Write();
01279 emaxSuperClusters_->Write();
01280 phiWidthSuperClusters_->Write();
01281
01282 energySuperClustersEl_->Write();
01283 sizeSuperClustersEl_->Write();
01284 emaxSuperClustersEl_->Write();
01285 phiWidthSuperClustersEl_->Write();
01286
01287 ptDiff->Write();
01288 pDiff->Write();
01289 pElectronFailed->Write();
01290 ptElectronFailed->Write();
01291 pElectronPassed->Write();
01292 ptElectronPassed->Write();
01293 sizeSuperClustersPassed->Write();
01294 sizeSuperClustersFailed->Write();
01295
01296
01297
01298
01299
01300
01301 numSiStereoHits_->Write();
01302 numSiMonoHits_->Write();
01303 numSiMatchedHits_->Write();
01304
01305
01306 LogDebug("") << " Writing out ntuple is disabled for now " ;
01307 myTree_->Write();
01308
01309
01310 file_->Close();
01311 }
01312
01313
01314
01315
01316
01317
01318
01319
01320