11 #include <ktracker/SRecEvent.h>
39 cout <<
"!!WARNING!! OnlMonTrigEP::InitRunOnlMon(): roadset.LoadConfig returned " << ret <<
".\n";
42 cout <<
"Roadset " << m_rs_id << endl;
44 mi_evt = findNode::getClass<SQEvent >(topNode,
"SQEvent");
45 mi_vec_hit = findNode::getClass<SQHitVector >(topNode,
"SQHitVector");
46 if (!mi_evt || !mi_vec_hit) {
47 cout <<
PHWHERE <<
": Cannot find SQEvent and/or SQHitVector." << endl;
51 mi_evt_emb = findNode::getClass<SQEvent >(topNode,
"SQEventEmb");
52 mi_evt_mc = findNode::getClass<SQMCEvent >(topNode,
"SQMCEvent");
53 mi_evt_mc_emb = findNode::getClass<SQMCEvent >(topNode,
"SQMCEventEmb");
54 mi_vec_trk = findNode::getClass<SQTrackVector >(topNode,
"SQTruthTrackVector");
55 mi_vec_dim = findNode::getClass<SQDimuonVector>(topNode,
"SQTruthDimuonVector");
56 mi_vec_trk_rec = findNode::getClass<SQTrackVector >(topNode,
"SQRecTrackVector");
57 mi_vec_dim_rec = findNode::getClass<SQDimuonVector>(topNode,
"SQRecDimuonVector_PM");
59 if (!mi_evt_emb ) cout <<
"No SQEventEmb node." << endl;
60 if (!mi_evt_mc ) cout <<
"No SQMCEvent node." << endl;
61 if (!mi_evt_mc_emb) cout <<
"No SQMCEventEmb node." << endl;
62 if (!mi_vec_trk ) cout <<
"No SQTruthTrackVector node." << endl;
63 if (!mi_vec_dim ) cout <<
"No SQTruthDimuonVector node." << endl;
64 if (!mi_vec_trk_rec) cout <<
"No SRecTrackVector node." << endl;
65 if (!mi_vec_dim_rec) cout <<
"No SRecDimuonVector_PM node." << endl;
67 mo_file =
new TFile(
"ana_tree.root",
"RECREATE");
68 mo_tree =
new TTree(
"tree",
"Created by AnaEmbeddedData");
69 mo_tree->Branch(
"evt" , &mo_evt);
70 mo_tree->Branch(
"occ" , &mo_occ);
71 mo_tree->Branch(
"trk_true", &mo_trk_true);
72 mo_tree->Branch(
"trk_reco", &mo_trk_reco);
73 mo_tree->Branch(
"dim_true", &mo_dim_true);
74 mo_tree->Branch(
"dim_reco", &mo_dim_reco);
99 mo_occ.
D1 = mo_occ.
D2 = mo_occ.
D3p = mo_occ.
D3m = 0;
103 if ( 0 < det_id && det_id <= 6) mo_occ.
D1++;
104 else if (12 < det_id && det_id <= 18) mo_occ.
D2++;
105 else if (18 < det_id && det_id <= 24) mo_occ.
D3p++;
106 else if (24 < det_id && det_id <= 30) mo_occ.
D3m++;
109 map<int, int> list_cnt;
111 const SQHit* hit = *it;
131 for (
unsigned int ii = 0; ii < mi_vec_trk->
size(); ii++) {
136 mo_trk_true.push_back(td);
141 for (
unsigned int ii = 0; ii < mi_vec_dim->
size(); ii++) {
150 mo_dim_true.push_back(dd);
157 if (mi_vec_trk_rec) {
159 for (
int ii = 0; ii < mi_vec_trk_rec->
size(); ii++) {
168 mo_trk_reco.push_back(td);
171 if (mi_vec_dim_rec) {
173 for (
int ii = 0; ii < mi_vec_dim_rec->
size(); ii++) {
197 mo_dim_reco.push_back(dd);
226 void AnaEmbeddedData::DivideHitVector(
const SQHitVector* vec_in, std::map<int, SQHitVector*>& vec_sep,
const bool in_time)
231 const SQHit* hit = *it;
235 if (hv == 0) vec_sep[det_id] = hv = vec0->
Clone();
int Init(PHCompositeNode *topNode)
AnaEmbeddedData(const std::string name="AnaEmbeddedData")
int End(PHCompositeNode *topNode)
Called at the end of all processing.
int process_event(PHCompositeNode *topNode)
int InitRun(PHCompositeNode *topNode)
User interface class about the geometry of detector planes.
int getDetectorID(const std::string &detectorName) const
Get the plane position.
static GeomSvc * instance()
singlton instance
virtual int get_IntFlag(const std::string &name) const
virtual const SQDimuon * at(const size_t id) const =0
virtual size_t size() const =0
An SQ interface class to hold one true or reconstructed dimuon.
virtual TLorentzVector get_mom_neg() const =0
Return the momentum of the negative track at vertex.
virtual TLorentzVector get_mom_pos() const =0
Return the momentum of the positive track at vertex.
virtual TLorentzVector get_mom() const =0
Return the dimuon momentum at vertex.
virtual TVector3 get_pos() const =0
Return the dimuon position at vertex.
virtual int get_qie_rf_intensity(const short i) const =0
Return the i-th QIE RF intensity, where i=-16...+16.
virtual bool get_trigger(const SQEvent::TriggerMask i) const =0
Return the trigger bit (fired or not) of the selected trigger channel.
virtual int get_spill_id() const =0
Return the spill ID.
virtual int get_event_id() const =0
Return the event ID, which is unique per run.
An SQ interface class to hold a list of SQHit objects.
virtual SQHitVector * Clone() const =0
std::vector< SQHit * >::const_iterator ConstIter
virtual ConstIter end() const =0
virtual ConstIter begin() const =0
virtual void push_back(const SQHit *hit)=0
An SQ interface class to hold one detector hit.
virtual bool is_in_time() const
Return 'true' if this hit is in the time window.
virtual short get_detector_id() const
Return the detector ID of this hit.
virtual double get_weight() const =0
Return the event weight.
virtual const SQTrack * at(const size_t id) const =0
virtual size_t size() const =0
An SQ interface class to hold one true or reconstructed track.
virtual int get_charge() const =0
Return the charge, i.e. +1 or -1.
virtual TLorentzVector get_mom_vtx() const =0
Return the track momentum at vertex.
TLorentzVector p_neg_target
virtual TVector3 get_pos() const
Return the dimuon position at vertex.
TLorentzVector p_pos_target
Track momentum projections at different location.
virtual int get_track_id_neg() const
Return the track ID of the negative track.
virtual int get_track_id_pos() const
Return the track ID of the positive track.
Int_t getCharge() const
Gets.
TLorentzVector getMomentumVertex()
Get the vertex info.
virtual double get_chisq() const
virtual TVector3 get_pos_vtx() const
Return the track position at vertex.
TrigRoad * FindRoad(const int road_id)
int LoadConfig(const std::string dir)
static recoConsts * instance()
void CalcVar(const SQDimuon *dim, double &mass, double &pT, double &x1, double &x2, double &xF)
Calculate the key kinematic variables of dimuon.
void Lab2CollinsSoper(const SQDimuon *dim, double &costh, double &phi)
Convert the momenta of muon pair from Lab frame to Collins-Soper frame.