Help Me With My Project Please :)

Hello all.

I’m undertaking a 3rd year project called ‘Electrons and Photons at the LHC’. The aim is to eventually work out a correction for the 5x5 algorithm for the Endcap crystals on the ECAL. The crystals darken due to the formation of colour centers, so scintillation photons are lost and possibly the resolution of the ECAL is lowered because of this.

This requires coding, lots and lots of it. And I only just started using C++ and ROOT when I started doing this project. Now obviously I will have alot of issues and need help, the HyperNews forums are somewhat hostile to anyone who doesn’t know what they are talking about. I have a computer account at CERN, I’m using lx.cern.plus and I have written my own analyzer and steadily giving it more functions and making it better.

So I figured I could make my own little thread in the general section asking for help on any serious problems I encounter in my project. Is that ok with you guys?

First question:

I’ve asked my analyzer to start plotting the Pseudorapidity and Azimuth Angles of clusters in the data file that I’m using. The Azimuth Angles are giving negatives values when they are supposed to be in degrees. How do I get the code to account for the fact that I need it in degrees? Here is the code:

if (electrons->sixe()==2) { reco::GsfElectronCollection::const_iterator e0=electrons->begin(); reco::GsfElectronCollection::const_iterator e1=electrons->end()-1; LogInfo("Demo")<<"Pseudorapidity "<<e0->eta()<<" "<<e1->eta(); LogInfo("Demo")<<"Azimuth Angle "<<e0->phi()<<" "<<e1->phi(); double eta= e0->eta() +e1->eta(); double phi= e0->phi() +e1->phi(); h_clusterposition->Fill(eta,phi)

I’m guessing it has something to do with me defining eta as ‘double’… What is the definition for an angular value? Has it also got something to do with ‘reco::GsfElectronCollection::const_iterator’? Because I’m not looking at individual electrons anymore I’m now looking at them in the clusters, or the cluster positions. I included the appropriate module (CaloCluster.h) but I don’t know what the “rec::_______” is for CaloCluster.

Lastly, I think I have my formula wrong! I have a horrible feeling that I’m adding 2 clusters/electrons together in the array of 2! How to I state them separately and not add them together but still taking all of them into account?

Thanks in advance!

How do I make the points larger on a 2D Histogram? I have 32 entries on a histogram that I drew using C++ code and using root to view the ROOT file, but the points appear too small.

see root.cern.ch/root/html/TAttMarker.html#M3

h2->SetMarkerStyle(…)
h2->SetMarkSize(…)

Thanks. Btw in my first post, I mean to say ‘HyperNews’, the CERN message board.

I’m trying to turn this statement into a ‘for loop’:

if (electrons->sixe()==2) { reco::GsfElectronCollection::const_iterator e0=electrons->begin(); reco::GsfElectronCollection::const_iterator e1=electrons->end()-1; LogInfo("Demo")<<"Pseudorapidity "<<e0->eta()<<" "<<e1->eta(); LogInfo("Demo")<<"Azimuth Angle "<<e0->phi()<<" "<<e1->phi(); double eta= e0->eta() +e1->eta(); double phi= e0->phi() +e1->phi(); h_clusterposition->Fill(eta,phi) }

My plot is wrong because it seems like I’m adding both electrons in the array . I just want it to run through each electron in the array and plot the data.

I’m thinking:

if (electrons->sixe()==2) { reco::GsfElectronCollection::const_iterator e0=electrons->begin(); reco::GsfElectronCollection::const_iterator e1=electrons->end()-1; LogInfo("Demo")<<"Pseudorapidity "<<e0->eta()<<" "<<e1->eta(); LogInfo("Demo")<<"Azimuth Angle "<<e0->phi()<<" "<<e1->phi(); for e0, e1 do { eta(); } return; for e0, e1 do { phi(); } return; double eta= eta() double phi= phi() h_clusterposition->Fill(eta,phi) }

Ignore the previous post I got it working :slight_smile:

I need to make a pointer.

Basically I want to plot cluster size/position/energies ect. But I need to make a point to cluster functions in order to do that.

I have a module GsfElectrons which has basicClustersBegin ( ) as one of it’s functions. basicClustersBegin has references to superCluster( ) which then has a direct access of:

CaloCluster_iterator basicClustersBegin() const { return superCluster()->clustersBegin() ; }

I can somehow use this to be able to call out functions from calocluster in order to plot/analyze what I need. But I am unsure of how to write the code.

Can I get some help please?

What I have done so far:

using namespace edm;

Handlereco::CaloClusterCollection cluster;
iEvent.getByLabel(“caloCluster”,cluster);
LogInfo(“Demo”)<<"size of cluster "<size();

And then in the analyze section:

if (cluster->size()==2)
{
reco::CaloClusterCollection::CaloCluster_iterator e2=basicClustersBegin

So I’m now confused because I don’t know if this is remotely correct. Maybe one of you Cern personnel can help me out?

BTW if I am annoying anyone with my thread then please say so and maybe you can designate someone to help me through PM? Thanks in advance though!

How do I draw a 3D histogram that has bars instead of dots?

I drew one, and it came out in dots rather than solid bars. I looked at the marker style table and I cannot see where to change it to solid bars.

have you tried the option E ?

Thank you for your reply, it is becoming increasingly difficult to get help :frowning:

I’m not even sure what ‘Option E’ is. Can you elaborate?

Also, I have an std::pair that I want to access.

Is is my code that I used to form an array of points:

const std::vector< std::pair<DetId, float> > programmingishard= (*it)->hitsAndFractions();

Where DetId returns recorded hits on the clusters, float returns energy.

Any ideas on how to access these values please? Thanks once again for your patience.

Sorry, I was wrong option E does not exist for 3d Histogram.
See the available drawing options here:

root.cern.ch/root/html/THistPainter.html#HP25

Try to split your questions in several posts: one question per post. Avoid general post with many questions inside.
you will get more help that way.