39 #include "StRareMaker.h"
40 #include "StRareEvent.h"
41 #include "StRareEventCut.h"
42 #include "StRareTrackCut.h"
43 #include "StL3RareTrackCut.h"
44 #include "StAcceptAllEvents.h"
45 #include "StAcceptAllTracks.h"
46 #include "StAcceptAllL3Tracks.h"
48 #include "StEventTypes.h"
49 #include "StMessMgr.h"
50 #include "StarClassLibrary/StThreeVector.hh"
56 static const
char rcsid[] = "$Id:
StRareMaker.cxx,v 1.8 2002/01/18 19:14:10 struck Exp $";
58 double dEdx_formula(
double momentum,
double mass);
64 out =
new TFile(fileName,
"RECREATE");
65 out->SetCompressionLevel(2);
66 m_Tree =
new TTree(
"RareTree",
"RareTree");
69 m_Tree->SetAutoSave(10000000);
70 m_Tree->Branch(
"StRareEvent",
"StRareEvent", &mRareEvent, 64000, 1);
76 StRareMaker::StRareMaker(
const Char_t *name,
const Char_t* fileName,
78 out =
new TFile(fileName,
"RECREATE");
79 out->SetCompressionLevel(2);
80 m_Tree =
new TTree(
"RareTree",
"RareTree", 1000000);
82 m_Tree->SetAutoSave(10000000);
84 m_Tree->Branch(
"StRareEvent",
"StRareEvent", &mRareEvent, 64000, 1);
90 StRareMaker::StRareMaker(
const Char_t *name,
const Char_t* fileName,
95 out =
new TFile(fileName,
"RECREATE");
96 out->SetCompressionLevel(2);
97 m_Tree =
new TTree(
"RareTree",
"RareTree", 1000000);
99 m_Tree->SetAutoSave(10000000);
101 m_Tree->Branch(
"StRareEvent",
"StRareEvent", &mRareEvent, 64000, 1);
103 mTrackCut = trackCut;
104 mL3TrackCut = l3trackCut;
114 mEvent = (
StEvent *) GetInputDS(
"StEvent");
115 if (!mEvent)
return kStOK;
119 cout <<
" event ID = " << mEvent->id() << endl;
120 int runNumber = mEvent->runId();
127 cout <<
"No l0 trigger found.\n";
128 cout <<
"Skip this event!\n";
131 else if (l0Trigger->triggerWord()<0x1000 ||
132 l0Trigger->triggerWord()>0x1fff) {
141 if (!l3EventSummary) {
142 cout <<
"No l3 event summary found." << endl;
145 bool take = l3EventSummary->unbiasedTrigger();
147 const StPtrVecL3AlgorithmInfo& algInfo = l3EventSummary->algorithmsAcceptingEvent();
148 for (
unsigned int i=0; i<algInfo.size(); i++) {
149 if (algInfo[i]->
id() == 6) take = kTRUE;
154 if (mEventCut->Accept(mEvent)) {
155 mRareEvent->fillRareEvent(mEvent);
156 StPrimaryTrackIterator itr;
158 if (mEvent->primaryVertex()) {
159 StSPtrVecPrimaryTrack& tracks = mEvent->primaryVertex()->daughters();
160 for (itr=tracks.begin(); itr != tracks.end(); itr++){
162 if (mTrackCut->Accept(trk)) mRareEvent->addTrack(trk);
167 float l3zVertex = -999;
168 if (mL3TrackCut && l3Event) {
169 mRareEvent->fillL3Info(l3Event);
170 if (l3Event->primaryVertex())
171 l3zVertex = l3Event->primaryVertex()->position().z();
174 StSPtrVecTrackNode& mtracknodes = (StSPtrVecTrackNode&) l3Event->trackNodes();
175 for (
unsigned int i=0; i<mtracknodes.size(); i++) {
180 int charge = oldHelix->charge();
181 short int h = oldHelix->helicity();
183 if (runNumber==2291023) {
186 float kapa = oldHelix->curvature();
187 float lambda = oldHelix->dipAngle();
189 kapa, lambda, oldHelix->origin(),
190 oldHelix->momentum(), h);
191 l3trk->setGeometry(newHelix);
200 if (l3zVertex!=-999) {
202 float dca2d = oldHelix->helix().
distance(vertex);
205 l3trk->setImpactParameter(dca2d);
208 if (mL3TrackCut->Accept(l3trk)) mRareEvent->addL3Track(l3trk);
222 Int_t StRareMaker::Init() {
223 number_of_events_processed = 0;
225 return StMaker::Init();
228 void StRareMaker::Report(){
234 void StRareMaker::PrintInfo() {
235 printf(
"**************************************************************\n");
236 printf(
"* $Id: StRareMaker.cxx,v 1.8 2002/01/18 19:14:10 struck Exp $\n");
237 printf(
"**************************************************************\n");
virtual void Clear(Option_t *option="")
User defined functions.
double distance(const StThreeVector< double > &p, bool scanPeriods=true) const
minimal distance between point and helix