1 void SpinAnalysisTreeReaderPDSF(
const long nevents = 20) {
8 reader->selectDataset(
"$STAR/StRoot/StSpinPool/StSpinTree/datasets/run6_pdsf.dataset");
12 reader->connectJets =
true;
13 reader->connectNeutralJets =
false;
14 reader->connectChargedPions =
true;
15 reader->connectBemcPions =
true;
16 reader->connectBemcElectrons =
true;
17 reader->connectEemcPions =
false;
21 reader->selectRun(7143025);
24 reader->selectTrigger(137221);
25 reader->selectTrigger(137222);
26 reader->selectTrigger(137611);
27 reader->selectTrigger(137622);
28 reader->selectTrigger(5);
31 reader->requireDidFire =
true;
32 reader->requireShouldFire =
true;
36 long entries = reader->GetEntries();
37 if(entries > nevents) entries = nevents;
38 for(
int i=0; i<entries; i++) {
42 int runId = ev->runId();
43 int eventId = ev->eventId();
45 printf(
"----------------Reading Event %d of %d----------------\n",i+1,entries);
46 printf(
"basics: Run = %d, Event = %d\n",runId,eventId);
49 TClonesArray *trigs = ev->triggers();
50 for(
int j=0; j<trigs->GetEntries(); j++) {
52 int trigId = aTrig->trigId();
53 bool didFire = aTrig->didFire();
54 int shouldFire = aTrig->shouldFire();
58 printf(
"ERROR LOADING TRIGGER HEADER FOR %d\n",trigId);
61 float prescale = header->prescale;
63 printf(
"trigger = %6d prescale = %8.1f didFire = %d shouldFire =% d\n",trigId,prescale,didFire,shouldFire);
67 int nVertices = ev->vertices()->GetEntries();
70 printf(
"nVertices = %d position of best = %f\n",nVertices,bestVert->position()[2]);
72 else if(nVertices == 0){
73 printf(
"no vertices found in this event\n");
76 printf(
"ERROR LOADING BEST VERTEX IN THIS EVENT\n");
82 printf(
"nJets = %d\n",reader->nJets());
83 for(
int j=0; j<reader->nJets(); j++) {
84 StJet* aJet = reader->jet(j);
86 if(bestVert) printf(
"jet pt=%7.4f jet eta=% 1.4f det eta=% 1.4f E_neu/E_tot=%1.4f\n",aJet->
jetPt,aJet->
jetEta,aJet->detEta(bestVert->position()[2]),R);
87 else printf(
"jet pt=%7.4f jet eta=% 1.4f no vertex E_neu/E_tot=%1.4f\n",aJet->
jetPt,aJet->
jetEta,R);
91 printf(
"nChargedPions = %d\n",reader->nChargedPions());
92 for(
int j=0; j<reader->nChargedPions(); j++) {
94 printf(
"pt=%7.4f eta=% 1.4f nSigmaPion=% 1.4f\n",aPion->
pt(),aPion->
eta(),aPion->
nSigmaPion());
98 printf(
"nNeutralPions = %d\n",reader->nBemcPions());
99 for(
int j=0; j<reader->nBemcPions(); j++) {
101 printf(
"neutral pion mass=%f pt=%f eta=%f\n",aPi0->Mass(),aPi0->Pt(),aPi0->Eta());
104 cout <<
"-----------------------------------------------------" << endl;
110 void LoadSpinTreeLibs() {
111 gSystem->Load(
"libPhysics");
112 gSystem->Load(
"St_base");
113 gSystem->Load(
"StChain");
114 gSystem->Load(
"St_Tables");
115 gSystem->Load(
"StEvent");
116 gSystem->Load(
"StDetectorDbMaker");
117 gSystem->Load(
"StEmcUtil");
118 gSystem->Load(
"StStrangeMuDstMaker");
119 gSystem->Load(
"StMuDSTMaker");
120 gSystem->Load(
"StSpinDbMaker");
121 gSystem->Load(
"StEmcTriggerMaker");
122 gSystem->Load(
"StJetFinder");
123 gSystem->Load(
"StJetMaker");
124 gSystem->Load(
"StMcEvent");
125 gSystem->Load(
"StChargedPionAnalysisMaker");
126 gSystem->Load(
"StSpinTree");
float nSigmaPion() const
Returns Craig's distance to the calculated dE/dx band for pions in units of sigma.
float jetPt
Pt (stored for convenience when drawing TTree)
float jetEta
Eta (stored for convenience when drawing TTree)
float pt() const
Returns pT at point of dca to primary vertex.
float eta() const
Returns pseudo rapidity at point of dca to primary vertex.
float btowEtSum
The summed Et from Barrel towers.