Skip to Content.
Sympa Menu

sphenix-software-l - Re: [Sphenix-software-l] [Sphenix-jet-structure-l] fast jet -> pseudo jet area?

sphenix-software-l AT lists.bnl.gov

Subject: sPHENIX discussion of software

List archive

Chronological Thread  
  • From: Rosi Reed <rjr215 AT lehigh.edu>
  • Cc: "sphenix-software-l AT lists.bnl.gov" <sphenix-software-l AT lists.bnl.gov>, "sphenix-jet-structure-l AT lists.bnl.gov" <sphenix-jet-structure-l AT lists.bnl.gov>
  • Subject: Re: [Sphenix-software-l] [Sphenix-jet-structure-l] fast jet -> pseudo jet area?
  • Date: Thu, 18 May 2017 09:31:50 -0400

Hi All,

My git diff is attached... Apparently one can actually see in this
particular star directory. (Feature? Bug? I leave that exercise up
to the reader.)

Cheers,

Rosi

On Wed, May 17, 2017 at 5:59 PM, Rosi Reed <rjr215 AT lehigh.edu> wrote:
> Hi Dennis,
>
> I'm not sure if you guys can see it, but it is at:
> /star/data05/scratch/rjreed/sphenix
>
> I'm not a git expert, is there a way to use it to show differences
> without committing the code? I have touched a few core classes and
> certainly don't want to break things for everyone....
>
> Cheers,
>
> Rosi
>
> On Wed, May 17, 2017 at 5:13 PM, Perepelitsa, Dennis <dvp AT bnl.gov> wrote:
>> Hi Rosi,
>>
>> To understand what you’re doing, is there a git commit (or a text file
>> with diffs, or a pointer to a working version) we could look at? I think
>> that would help me, at least, better understand the problem...
>>
>> Dennis
>>
>>> On May 17, 2017, at 2:30 PM, Rosi Reed <rjr215 AT lehigh.edu> wrote:
>>>
>>> Hello All,
>>>
>>> I am implementing the STAR/ALICE background subtraction algorithm in
>>> sPHENIX and ran into an issue that I am sure is rather simple, but I
>>> am not sure what to do about it.
>>>
>>> For this algorithm, I need to get the area of the jet. Normally I
>>> access this from a vector of pseudo jets via:
>>> jets[i].area()
>>>
>>> I have added all the necessary machinery (and it compiles, thanks to
>>> Chris!) but when I run the fun4all macro, I get the error:
>>> fastjet::Error: you requested jet-area related information, but the
>>> PseudoJet does not have associated area information.
>>>
>>> Any thoughts? (Yes, I changed FastJetAlgo.C)
>>>
>>> Cheers,
>>> Rosi
>>>
>>>
>>>
>>> --
>>> Rosi Reed
>>> Assistant Professor, Physics Department
>>> Lehigh University
>>> (610)758-3907
>>> 16 Memorial Drive East Office 406
>>> Bethlehem, PA 18015
>>> _______________________________________________
>>> sPHENIX-jet-structure-l mailing list
>>> sPHENIX-jet-structure-l AT lists.bnl.gov
>>> https://lists.bnl.gov/mailman/listinfo/sphenix-jet-structure-l
>>
>> Dennis V. Perepelitsa
>> Assistant Professor, Physics Department
>> University of Colorado Boulder
>>
>>
>>
>
>
>
> --
> Rosi Reed
> Assistant Professor, Physics Department
> Lehigh University
> (610)758-3907
> 16 Memorial Drive East Office 406
> Bethlehem, PA 18015



--
Rosi Reed
Assistant Professor, Physics Department
Lehigh University
(610)758-3907
16 Memorial Drive East Office 406
Bethlehem, PA 18015
diff --git a/simulation/g4simulation/g4eval/JetEvaluator.C
b/simulation/g4simulation/g4eval/JetEvaluator.C
index f416dfb..3b67be4 100644
--- a/simulation/g4simulation/g4eval/JetEvaluator.C
+++ b/simulation/g4simulation/g4eval/JetEvaluator.C
@@ -48,10 +48,10 @@ int JetEvaluator::Init(PHCompositeNode *topNode) {
if (_do_recojet_eval) _ntp_recojet = new TNtuple("ntp_recojet","reco jet
=> max truth jet",

"event:id:ncomp:eta:phi:e:pt:"

"gid:gncomp:geta:gphi:ge:gpt:"
- "efromtruth");
+ "area:efromtruth");

if (_do_truthjet_eval) _ntp_truthjet = new TNtuple("ntp_truthjet","truth
jet => best reco jet",
-
"event:gid:gncomp:geta:gphi:ge:gpt:"
+
"event:gid:gncomp:geta:gphi:ge:gpt:area:"
"id:ncomp:eta:phi:e:pt:"
"efromtruth");

@@ -163,6 +163,7 @@ void JetEvaluator::fillOutputNtuples(PHCompositeNode
*topNode) {
float gphi = NAN;
float ge = NAN;
float gpt = NAN;
+ float area = NAN;
float efromtruth = NAN;

if (truthjet) {
@@ -172,10 +173,11 @@ void JetEvaluator::fillOutputNtuples(PHCompositeNode
*topNode) {
gphi = truthjet->get_phi();
ge = truthjet->get_e();
gpt = truthjet->get_pt();
+ area = truthjet->get_A();
efromtruth = recoeval->get_energy_contribution(recojet,truthjet);
}

- float recojet_data[14] = {(float) _ievent,
+ float recojet_data[15] = {(float) _ievent,
id,
ncomp,
eta,
@@ -188,6 +190,7 @@ void JetEvaluator::fillOutputNtuples(PHCompositeNode
*topNode) {
gphi,
ge,
gpt,
+ area,
efromtruth
};

@@ -221,6 +224,7 @@ void JetEvaluator::fillOutputNtuples(PHCompositeNode
*topNode) {
float gphi = truthjet->get_phi();
float ge = truthjet->get_e();
float gpt = truthjet->get_pt();
+ float area = truthjet->get_A();

float id = NAN;
float ncomp = NAN;
@@ -240,13 +244,14 @@ void JetEvaluator::fillOutputNtuples(PHCompositeNode
*topNode) {
efromtruth = recoeval->get_energy_contribution(recojet,truthjet);
}

- float truthjet_data[14] = {(float) _ievent,
+ float truthjet_data[15] = {(float) _ievent,
gid,
gncomp,
geta,
gphi,
ge,
gpt,
+ area,
id,
ncomp,
eta,
diff --git a/simulation/g4simulation/g4jets/FastJetAlgo.C
b/simulation/g4simulation/g4jets/FastJetAlgo.C
index 7c66957..a81fbb8 100644
--- a/simulation/g4simulation/g4jets/FastJetAlgo.C
+++ b/simulation/g4simulation/g4jets/FastJetAlgo.C
@@ -24,7 +24,7 @@ FastJetAlgo::FastJetAlgo(Jet::ALGO algo, float par, float
verbosity)
_par(par) {
fastjet::ClusterSequence clusseq;
if (_verbosity > 0) {
- clusseq.print_banner();
+ clusseq.print_banner();
} else {
ostringstream nullstream;
clusseq.set_fastjet_banner_stream(&nullstream);
@@ -75,6 +75,7 @@ std::vector<Jet*> FastJetAlgo::get_jets(std::vector<Jet*>
particles) {
jet->set_py(fastjets[ijet].py());
jet->set_pz(fastjets[ijet].pz());
jet->set_e(fastjets[ijet].e());
+ jet->set_A(fastjets[ijet].area());
jet->set_id(ijet);

// copy components into output jet
diff --git a/simulation/g4simulation/g4jets/Jet.h
b/simulation/g4simulation/g4jets/Jet.h
index 05f20d6..daeacd4 100644
--- a/simulation/g4simulation/g4jets/Jet.h
+++ b/simulation/g4simulation/g4jets/Jet.h
@@ -52,13 +52,21 @@ public:
virtual float get_e() const {return NAN;}
virtual void set_e(float e) {return;}

+ virtual float get_A() const {return NAN;}
+ virtual void set_A(float A) {return;}
+
+ virtual float get_rho() const {return NAN;}
+ virtual void set_rho(float rho) {return;}
+
virtual float get_p() const {return NAN;}
virtual float get_pt() const {return NAN;}
virtual float get_et() const {return NAN;}
virtual float get_eta() const {return NAN;}
virtual float get_phi() const {return NAN;}
virtual float get_mass() const {return NAN;}
-
+ virtual float get_ptsub() const {return NAN;}
+
+
// extended jet info
---------------------------------------------------------

virtual bool has_property(Jet::PROPERTY prop_id) const {return false;}
diff --git a/simulation/g4simulation/g4jets/JetV1.C
b/simulation/g4simulation/g4jets/JetV1.C
index bff37c4..31db008 100644
--- a/simulation/g4simulation/g4jets/JetV1.C
+++ b/simulation/g4simulation/g4jets/JetV1.C
@@ -19,6 +19,8 @@ JetV1::JetV1()
: _id(0xFFFFFFFF),
_mom(),
_e(NAN),
+ _A(NAN),
+ _rho(NAN),
_comp_ids(),
_property_map() {
for (int i = 0; i < 3; ++i) _mom[i] = NAN;
@@ -29,6 +31,7 @@ void JetV1::identify(ostream& os) const {
os << "jetid: " << get_id() << endl;
os << " (px,py,pz,e) = (" << get_px() << ", " << get_py() << ", ";
os << get_pz() << ", " << get_e() << ") GeV" << endl;
+ os << "Area = " << get_A() << ", rho = " << get_rho() << " GeV/c" << endl;
print_property(os);
for (ConstIter citer = begin_comp(); citer != end_comp(); ++citer) {
cout << citer->first << " -> " << citer->second << endl;
@@ -42,6 +45,8 @@ void JetV1::Reset() {
_id = 0xFFFFFFFF;
for (int i = 0; i < 3; ++i) _mom[i] = NAN;
_e = NAN;
+ _A = NAN;
+ _rho = NAN;
_comp_ids.clear();
_property_map.clear();
}
@@ -86,6 +91,10 @@ float JetV1::get_mass() const {
return sqrt(get_e()*get_e()-p2);
}

+float JetV1::get_ptsub() const {
+ return get_pt() - get_A()*get_rho();
+}
+
bool JetV1::has_property(Jet::PROPERTY prop_id) const {
typ_property_map::const_iterator citer = _property_map.find(prop_id);
if (citer==_property_map.end()) return false;
diff --git a/simulation/g4simulation/g4jets/JetV1.h
b/simulation/g4simulation/g4jets/JetV1.h
index 49cdf5a..7eeab3a 100644
--- a/simulation/g4simulation/g4jets/JetV1.h
+++ b/simulation/g4simulation/g4jets/JetV1.h
@@ -45,12 +45,19 @@ public:
float get_e() const {return _e;}
void set_e(float e) {_e = e;}

+ float get_A() const {return _A;}
+ void set_A(float A) {_A = A;}
+
+ float get_rho() const {return _rho;}
+ void set_rho(float rho) {_rho = rho;}
+
float get_p() const;
float get_pt() const;
float get_et() const;
float get_eta() const;
float get_phi() const;
float get_mass() const;
+ float get_ptsub() const;

// extended jet info

@@ -96,6 +103,12 @@ private:
/// jet energy
float _e;

+ /// jet area
+ float _A;
+
+ ///energy density to be subtracted
+ float _rho;
+
/// source id -> component id
typ_comp_ids _comp_ids;




Archive powered by MHonArc 2.6.24.

Top of Page