Skip to content

Commit

Permalink
Update to trigger simulator to save intermediate jet patch ADCs and m…
Browse files Browse the repository at this point in the history
…inor cleanup to the jet maker (star-bnl#424)

1) Update to the trigger simulator to save the intermediate jet patch
sum ADCs and make them available to access for analysis. In this case
save the 30 jet patch ADCs in the StJetSkimEvent.
2) Remove unnecessary printouts in the StJetMaker2012 during the UE
offaxis cone calculation

Not urgent! May add additional edits if necessary.

Co-authored-by: Dmitry Kalinkin <[email protected]>
  • Loading branch information
zlchang and veprbl authored Dec 7, 2022
1 parent c1ee4ea commit 5350d16
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 20 deletions.
9 changes: 2 additions & 7 deletions StRoot/StJetMaker/StJetMaker2012.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int StJetMaker2012::Init()
TString branchname(jetbranch->name);
branchname.Append(jetuebranch->name);
mTreeUe->Branch(branchname, "StUeOffAxisConesEvent",&((jetuebranch->eventUe)[iBranch]));
cout<<jetbranch->name<<" initialized!"<<endl;
LOG_INFO<<jetbranch->name<<" and "<<jetuebranch->name<<" initialized!"<<endm;
}
}

Expand Down Expand Up @@ -395,16 +395,13 @@ double StJetMaker2012::addJetUe(StProtoJet::FourVecList particles, StUeOffAxisCo
pt[ii] = 0.;
number[ii] = 0;
}
cout<<"calculating UE from particles size: "<<particles.size()<<endl;

for(size_t ii = 0; ii < particles.size(); ii++){
StMuTrackFourVec * vect = (StMuTrackFourVec*)particles.at(ii);
//const AbstractFourVec * vect = particles.at(ii);
//cout<<"particle pt: "<<p_pt<<endl;
StThreeVector<double> mom(vect->px(), vect->py(), vect->pz());
double p_pt = mom.perp();
double p_eta = vect->eta();
double p_phi = vect->phi();
// cout<<"p_pt = "<<p_pt<<" p_eta = "<<p_eta<<" p_phi = "<<p_phi<<endl;

int index = -1;
double dR = DeltaR(p_eta, p_phi, cone_eta[0], cone_phi[0]);
Expand Down Expand Up @@ -460,7 +457,6 @@ double StJetMaker2012::addJetUe(StProtoJet::FourVecList particles, StUeOffAxisCo
jcones->setE(je);
jcones->setArea(jarea);
jcones->setDensity(density);
cout<<"add new jet to underlying event"<<endl;
jcones->addCone(cones[0]);
jcones->addCone(cones[1]);
StUeVertex *ueVertex = ueEvent->lastVertex();
Expand All @@ -479,6 +475,5 @@ double StJetMaker2012::DeltaR(double etaA, double phiA, double etaB, double phiB
if(dphi < -1.*PI) dphi += 2.*PI;

double dR = TMath::Sqrt(deta*deta+dphi*dphi);
// cout<<etaA<<" "<<phiA<<" "<<etaB<<" "<<phiB<<" "<<dR<<"\n";
return dR;
}
6 changes: 1 addition & 5 deletions StRoot/StJetMaker/StJetSkimEventMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,7 @@ Int_t StJetSkimEventMaker::Make()

if (trigSimu->emc) {
for (int i = 0; i < 3; ++i) mEvent->setOverlapJetPatchTh(i,trigSimu->emc->overlapJetPatchTh(i));
for (int i = 0; i < 2; ++i) {
int jp, adc;
trigSimu->emc->getOverlapJetPatchAdc(i,jp,adc);
mEvent->setOverlapJetPatchAdc(jp,adc);
}
for (int jp = 0; jp < 6; ++jp) mEvent->setOverlapJetPatchAdc(jp, trigSimu->emc->overlapJetPatchAdc(jp));
}

mEvent->setEmcLayer2(trigSimu->emc->EM201output());
Expand Down
4 changes: 3 additions & 1 deletion StRoot/StTriggerUtilities/Bemc/StBemcTriggerSimu.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ StBemcTriggerSimu::StBemcTriggerSimu()
mTables = NULL;
mHList = NULL;
mConfig = 0;

mTestMode = false;
}
//==================================================
//==================================================
Expand Down Expand Up @@ -3187,6 +3187,8 @@ int StBemcTriggerSimu::getJetPatchThreshold(int trigId, int dsmid) const {
int StBemcTriggerSimu::barrelJetPatchTh(int i) const { return mB101->getRegister(i); }
int StBemcTriggerSimu::barrelHighTowerTh(int i) const { return mB001->getRegister(i); }
int StBemcTriggerSimu::barrelJetPatchAdc(int jp) const { return (*mB101)[jp%6].info[(jp/6+2)%3]; }
int StBemcTriggerSimu::barrelPartialJetPatchAdc(int jp) const { //jp from 0 to 5, 6 high eta partical jet patch sum
return (*mB101)[jp%6].info[3]; }

void StBemcTriggerSimu::fillStEmcTriggerDetector()
{
Expand Down
1 change: 1 addition & 0 deletions StRoot/StTriggerUtilities/Bemc/StBemcTriggerSimu.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class StBemcTriggerSimu : public StVirtualTriggerSimu {
int barrelHighTowerTh(int i) const;

int barrelJetPatchAdc(int jp) const;
int barrelPartialJetPatchAdc(int jp) const;
int barrelHighTowerAdc(int towerId) const { return getHT6bitAdc(towerId); }

public:
Expand Down
1 change: 1 addition & 0 deletions StRoot/StTriggerUtilities/Eemc/StEemcTriggerSimu.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ int StEemcTriggerSimu::endcapJetPatchTh(int i) const { return mE101->getRegister
int StEemcTriggerSimu::endcapHighTowerTh(int i) const { return mE001->getRegister(i); }

int StEemcTriggerSimu::endcapJetPatchAdc(int jp) const { return (*mE101)[1-jp/3].info[jp%3]; }
int StEemcTriggerSimu::endcapPartialJetPatchAdc(int jp) const { return (*mE101)[1-jp/3].info[3+jp%3]; }

int StEemcTriggerSimu::getOutHT(int tp) const { return feeTPTreeADC->TP(tp)->getOutHT(); }
int StEemcTriggerSimu::getOutTPsum(int tp) const { return feeTPTreeADC->TP(tp)->getOutTPsum(); }
Expand Down
1 change: 1 addition & 0 deletions StRoot/StTriggerUtilities/Eemc/StEemcTriggerSimu.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class StEemcTriggerSimu : public StVirtualTriggerSimu {

int endcapJetPatchAdc(int jp) const;
int endcapHighTowerAdc(int towerId) const { return 0; }
int endcapPartialJetPatchAdc(int jp) const;

int getOutHT(int tp) const;
int getOutTPsum(int tp) const;
Expand Down
8 changes: 8 additions & 0 deletions StRoot/StTriggerUtilities/Emc/StEmcTriggerSimu.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,11 @@ void StEmcTriggerSimu::getOverlapJetPatchAdc(int i, int& jp, int& adc) const
jp = (1-i)*3+jp_partial-1;
adc = (*mEM201)[0].info[i];
}
int StEmcTriggerSimu::overlapJetPatchAdc(int jp) const
{
int adc = 0;
if(mBemc && mEemc){
adc = mBemc->barrelPartialJetPatchAdc(jp) + mEemc->endcapPartialJetPatchAdc(jp);
}
return adc;
}
1 change: 1 addition & 0 deletions StRoot/StTriggerUtilities/Emc/StEmcTriggerSimu.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class StEmcTriggerSimu : public StVirtualTriggerSimu {

int overlapJetPatchTh(int i) const;
void getOverlapJetPatchAdc(int i, int& jp, int& adc) const;
int overlapJetPatchAdc(int jp) const;

private:
// returns value of bit from x at position pos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,6 @@ void DSMAlgo_BC101_2009::operator()(DSM& dsm)
dsm.info[0] = jpx;
dsm.info[1] = jpy;
dsm.info[2] = jpz;
//partial sum
dsm.info[3] = jpPartial;
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,7 @@ void DSMAlgo_BC101_2013::operator()(DSM& dsm)
dsm.info[0] = jpx;
dsm.info[1] = jpy;
dsm.info[2] = jpz;
//partial sum
dsm.info[3] = jpPartial;

}
12 changes: 7 additions & 5 deletions StRoot/StTriggerUtilities/StDSMUtilities/DSMAlgo_BC101_2015.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ void DSMAlgo_BC101_2015::operator()(DSM& dsm)

// ACTION:

unsigned int jpx; // East (-1 < eta < 0)
unsigned int jpy; // Middle (-0.6 < eta < 0.4)
unsigned int jpz; // West (0 < eta < 1)
unsigned int jpPartial; // Partial (0.4 < eta < 1)
int jpx; // East (-1 < eta < 0)
int jpy; // Middle (-0.6 < eta < 0.4)
int jpz; // West (0 < eta < 1)
int jpPartial; // Partial (0.4 < eta < 1)

int highTowerBits;

Expand Down Expand Up @@ -101,8 +101,10 @@ void DSMAlgo_BC101_2015::operator()(DSM& dsm)
dsm.info[0] = jpx;
dsm.info[1] = jpy;
dsm.info[2] = jpz;
//partial sum
dsm.info[3] = jpPartial;
}
void getBemcJetPatchSums2015A(const DSM& bc101, unsigned int& jpx, unsigned int& jpy, unsigned int& jpz, unsigned int& jpPartial, int& highTowerBits)
void getBemcJetPatchSums2015A(const DSM& bc101, int& jpx, int& jpy, int& jpz, int& jpPartial, int& highTowerBits)
{
jpx = 0;
jpy = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
struct DSMAlgo_BC101_2015 : public DSMAlgo {
void operator()(DSM& dsm);
};
void getBemcJetPatchSums2015A(const DSM& bc101, unsigned int& jpx, unsigned int& jpy, unsigned int& jpz, unsigned int& jpPartial, int& highTowerBits);
void getBemcJetPatchSums2015A(const DSM& bc101, int& jpx, int& jpy, int& jpz, int& jpPartial, int& highTowerBits);
#endif // DSM_ALGO_BC101_2015_HH
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,9 @@ void DSMAlgo_EE101_2009::operator()(DSM& dsm)
dsm.info[0] = jpa;
dsm.info[1] = jpb;
dsm.info[2] = jpc;

//low partial eta sum
dsm.info[3] = lowEtaSumA; //4 o'clock
dsm.info[4] = lowEtaSumB; //6 o'clock
dsm.info[5] = lowEtaSumC; //8 o'clock
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,9 @@ void DSMAlgo_EE101_2013::operator()(DSM& dsm)
dsm.info[0] = jpa;
dsm.info[1] = jpb;
dsm.info[2] = jpc;

//low partial eta sum
dsm.info[3] = lowEtaSumA; //4 o'clock
dsm.info[4] = lowEtaSumB; //6 o'clock
dsm.info[5] = lowEtaSumC; //8 o'clock
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ void DSMAlgo_EE101_2017::operator()(DSM& dsm)
out |= maxId << 12;
out |= highTowerBits << 14;
dsm.output = out;

dsm.info[0] = jpa;
dsm.info[1] = jpb;
dsm.info[2] = jpc;
//low partial eta sum
dsm.info[3] = lowEtaSumA; //4 o'clock
dsm.info[4] = lowEtaSumB; //6 o'clock
dsm.info[5] = lowEtaSumC; //8 o'clock
}

void DSMAlgo_EE101_2017::getEemcLowerHalfJetPatchSums(const DSM& dsm, int& jpa, int& jpb, int& jpc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,8 @@ void DSMAlgo_EE102_2009::operator()(DSM& dsm)
dsm.info[0] = jpa;
dsm.info[1] = jpb;
dsm.info[2] = jpc;
//low eta sum
dsm.info[3] = lowEtaSumA; // 10 o'clock
dsm.info[4] = lowEtaSumB; // 12 o'clock
dsm.info[5] = lowEtaSumC; // 2 o'clock
}
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,9 @@ void DSMAlgo_EE102_2013::operator()(DSM& dsm)
dsm.info[0] = jpa;
dsm.info[1] = jpb;
dsm.info[2] = jpc;
//
//low eta sum
dsm.info[3] = lowEtaSumA; // 10 o'clock
dsm.info[4] = lowEtaSumB; // 12 o'clock
dsm.info[5] = lowEtaSumC; // 2 o'clock
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ void DSMAlgo_EE102_2017::operator()(DSM& dsm)
out |= highTowerBits << 14;

dsm.output = out;

dsm.info[0] = jpa;
dsm.info[1] = jpb;
dsm.info[2] = jpc;
//low eta sum
dsm.info[3] = lowEtaSumA; // 10 o'clock
dsm.info[4] = lowEtaSumB; // 12 o'clock
dsm.info[5] = lowEtaSumC; // 2 o'clock
}

void DSMAlgo_EE102_2017::getEemcUpperHalfJetPatchSums(const DSM& dsm, int& jpa, int& jpb, int& jpc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ void DSMAlgo_EM201_2017::operator()(DSM& dsm)

dsm.output = out;

dsm.info[0] = jpSum1;
dsm.info[1] = jpSum2;
}
void DSMAlgo_EM201_2017::getHybridJetPatchSums(const DSM& dsm, int& jpSum1, int& jpSum2)
{
Expand Down

0 comments on commit 5350d16

Please sign in to comment.