00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00012 #include <iostream>
00013 #include <cmath>
00014 #include "TGraphErrors.h"
00015 #include "TF1.h"
00016 #include "TH2D.h"
00017 #include "TH1D.h"
00018 #include "TMath.h"
00019 #include "Geometry/Geometry.h"
00020 #include "Geometry/PlaneGeo.h"
00021 #include "Geometry/CellGeo.h"
00022 #include "Header/Header.h"
00023 #include "Simulation/MCTruth.h"
00024 #include "Simulation/FLSHitList.h"
00025 #include "Simulation/FLSHit.h"
00026 #include "JobControl/Exception.h"
00027 #include "RecoBase/CellHit.h"
00028 #include "RecoBase/Cluster.h"
00029 #include "RecoBase/ShowerBase.h"
00030 #include "ClusterMakerSS/ClusterSSHelpers.h"
00031 #include "ClusterMakerSS/MakeClusterSS.h"
00032 #include "ClusterMakerSS/ClusterCheck.h"
00033
00034 using namespace std;
00035 using namespace clusterss;
00036
00037
00038 MODULE_DECL(ClusterCheck);
00039
00040 ClusterCheck::ClusterCheck(const char* version) :
00041 jobc::Module("makeclusterss::ClusterCheck")
00042 {
00043
00044 this->SetCfgVersion(version);
00045 }
00046
00047
00048
00049 void ClusterCheck::Update(const cfg::Config& )
00050 {
00051 }
00052
00053
00054
00055 ClusterCheck::~ClusterCheck()
00056 {
00057 }
00058
00059
00060
00061 jobc::Result ClusterCheck::Reco(edm::EventHandle& )
00062 {
00063
00064 return jobc::kPassed;
00065 }
00066
00067
00068
00069 jobc::Result ClusterCheck::Ana(const edm::EventHandle& evt)
00070 {
00071 const edm::EventHeader &eh = evt.Header();
00072 int run = eh.Run();
00073 int event = eh.Event();
00074 cout<<"*************** On run "<<run<<" event "<<event<<endl;
00075
00076
00077 std::vector<const hdr::Header*> head(0);
00078 try{ evt.DAQ().Get(".",head); }
00079 catch(edm::Exception e){
00080 cerr<<"Couldn't get a head"<<endl;
00081 return jobc::kFailed;
00082 }
00083 geo::Geometry &geom = geo::Geometry::Instance(1,head[0]->DetectorID());
00084
00085
00086
00087 std::vector<const recobase::CellHit*> hitlist(0);
00088 try{ evt.Cal().Get("./MergeHits",hitlist); }
00089 catch(edm::Exception e){
00090 cerr<<"Couldn't find the MergedCellHit list, trying for the original"<<endl;
00091 try{ evt.Cal().Get("./Hits",hitlist); }
00092 catch(edm::Exception e){
00093 cerr<<"Couldn't find the Original CellHit list either, failing."<<endl;
00094 return jobc::kFailed;
00095 }
00096 }
00097 if(hitlist.size()<5){
00098
00099
00100 }
00101
00102 std::vector<const sim::MCTruth*> truelist(0);
00103 try { evt.MC().Get(".", truelist); }
00104 catch(edm::Exception e){
00105 cerr<<"Couldn't get a truelist"<<endl;
00106 return jobc::kFailed;
00107 }
00108
00109
00110 int tidx=0;
00111 const TParticle &nupart = truelist[tidx]->GetNeutrino()->Nu();
00112 double eenu = 1.*nupart.Energy();
00113 if(eenu<0.100){
00114
00115
00116 }
00117
00118
00119 double nuvtxz=nupart.Vz();
00120 int vcont=1;
00121
00122
00123
00124
00125
00126
00127
00128
00129 if(nuvtxz>(geom.DetLength()-300)){
00130 vcont=0;
00131 }
00132 if(vcont==0){
00133
00134
00135 }
00136
00137 cout<<"Found an interaction of inu: "<<nupart.GetPdgCode()<<" CC/NC: "<<truelist[tidx]->GetNeutrino()->CCNC()<<endl;
00138 std::vector<const sim::FLSHitList*> flslist(0);
00139 try { evt.DetSim().Get(".", flslist); }
00140 catch(edm::Exception e){
00141 cerr<<"Couldn't get a flslist"<<endl;
00142 return jobc::kFailed;
00143 }
00144
00145
00146 std::vector<sim::FLSHit> flshits = flslist[tidx]->fHits;
00147 cout<<"Size of fls "<<flshits.size()<<endl;
00148 for(unsigned int i=0;i<flshits.size();i++){
00149 cout<<"Have a FLS hit in PLane: "<<flshits[i].fPlaneId<<" Cell "<<flshits[i].fCellId<<endl;
00150 cout<<" edep "<<flshits[i].fEdep<<" pdg of parent: "
00151 <<flshits[i].fPDG<<" track id "<<flshits[i].fTrackId<<endl;
00152 }
00153
00154
00155 std::vector<const recobase::Cluster *>xclusterlist(0);
00156 bool foundx=true;
00157 try{evt.Reco().Get("./SSClusterX",xclusterlist);}
00158 catch(edm::Exception e){
00159
00160 foundx=false;
00161 }
00162
00163 std::vector<const recobase::Cluster *>yclusterlist(0);
00164 bool foundy=true;
00165 try{evt.Reco().Get("./SSClusterY",yclusterlist);}
00166 catch(edm::Exception e){
00167
00168 foundy=false;
00169 }
00170
00171 std::vector<const recobase::Cluster *> &clist=xclusterlist;
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202 return jobc::kPassed;
00203
00204 }
00205