Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

clusterss::ClusterCheck Class Reference

#include <ClusterCheck.h>

Inheritance diagram for clusterss::ClusterCheck:

jobc::Module cfg::Observer List of all members.

Public Member Functions

 ClusterCheck (const char *version)
void Update (const cfg::Config &c)
 ~ClusterCheck ()
jobc::Result Reco (edm::EventHandle &evt)
jobc::Result Ana (const edm::EventHandle &evt)

Constructor & Destructor Documentation

ClusterCheck::ClusterCheck const char *  version  ) 
 

Definition at line 40 of file ClusterCheck.cxx.

References jobc::Module::SetCfgVersion().

00040                                               :
00041   jobc::Module("makeclusterss::ClusterCheck")
00042 {
00043   // Set the configuration version tag
00044   this->SetCfgVersion(version); // Required!
00045 }

ClusterCheck::~ClusterCheck  ) 
 

Definition at line 55 of file ClusterCheck.cxx.

00056 {
00057 }


Member Function Documentation

jobc::Result ClusterCheck::Ana const edm::EventHandle evt  )  [virtual]
 

Reimplemented from jobc::Module.

Definition at line 69 of file ClusterCheck.cxx.

References edm::EventHandle::Cal(), edm::EventHandle::DAQ(), geo::Geometry::DetLength(), edm::EventHandle::DetSim(), edm::EventHeader::Event(), edm::EventHandle::Header(), geo::Geometry::Instance(), edm::EventHandle::MC(), edm::EventHandle::Reco(), and edm::EventHeader::Run().

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   //now get a daq header and geometry
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   //get the list of CellHits
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     //    cerr<<"Not enough activity"<<endl;
00099     //    return jobc::kFailed; //lets just look at things that have some real activity
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   //get some truthiness
00110   int tidx=0;
00111   const TParticle &nupart = truelist[tidx]->GetNeutrino()->Nu();
00112   double eenu = 1.*nupart.Energy();
00113   if(eenu<0.100){
00114     //    cout<<"Not enough energy"<<endl;
00115     //    return jobc::kFailed;//let's just look at reasonable energy nus
00116   }
00117   //  double nuvtxx=nupart.Vx();
00118   //  double nuvtxy=nupart.Vy();
00119   double nuvtxz=nupart.Vz();
00120   int vcont=1;
00121   
00122   //  if(nuvtxx>-1.*(geom.DetHalfWidth()-20)&&nuvtxx<1.*(geom.DetHalfWidth()-20)){//20 cm in from xedges    
00123   //      if(nuvtxy>-1.*(geom.DetHalfHeight()-20)&&nuvtxy<1.*(geom.DetHalfHeight()-20)){//20 cm in from yedges
00124   //      if(nuvtxz>20&&nuvtxz<(geom.DetLength()-300)){//20 cm from front, and 300 cm from back (muon catcher)
00125   //      vcont=1;
00126   //}
00127   //}
00128   //}
00129   if(nuvtxz>(geom.DetLength()-300)){// 300 cm from back (muon catcher)
00130     vcont=0;
00131   }   
00132   if(vcont==0){ 
00133     //    cout<<"Not in Fid Vol"<<endl;
00134     //    return jobc::kFailed;
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     //    cerr<<"Couldn't find an xcluster"<<endl;
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     //    cerr<<"Couldn't find an ycluster"<<endl;
00168     foundy=false;
00169   }
00170 
00171   std::vector<const recobase::Cluster *> &clist=xclusterlist;
00172   /*
00173   for(int i=0;i<2;i++){
00174     bool fc=false;
00175     geo::View_t view;
00176     if(i==0){
00177       clist=xclusterlist;
00178       fc = foundx;
00179       view=geo::kX;
00180     }
00181     else{
00182       clist=yclusterlist;
00183       fc = foundy;
00184       view=geo::kY;
00185     }
00186  
00187     if(fc){
00188       cout<<"*************In view "<<view<<" found "<<clist.size()<<" clusters "<<endl;
00189       for(unsigned int i=0;i<clist.size();i++){
00190         //      cout<<"NEw tv cell"<<endl;
00191         recobase::Cluster *c = new recobase::Cluster(*clist[i]);
00192         cout<<"cluster "<<i<<" has "<<c->NCell(view)<<" cells"<<endl;
00193         for(int j=0;j<c->NCell(view);j++){
00194           cout<<"Found cell number "<<j<<endl;
00195           c->Cell(view,j)->Print("");     
00196         }
00197       }
00198     }    
00199   }
00200 */
00201 
00202   return jobc::kPassed; // kFailed if you want to fail the event
00203   
00204 }

jobc::Result ClusterCheck::Reco edm::EventHandle evt  )  [virtual]
 

Reimplemented from jobc::Module.

Definition at line 61 of file ClusterCheck.cxx.

00062 {
00063   
00064   return jobc::kPassed; // kFailed if you want to fail the event
00065 }

void ClusterCheck::Update const cfg::Config c  )  [virtual]
 

Implements cfg::Observer.

Definition at line 49 of file ClusterCheck.cxx.

00050 {
00051 }


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 04:45:30 2009 for NOvA Offline by  doxygen 1.3.9.1