Friday, October 27, 2006
Late update
I've been trying to a bit of everything lately and I have to say that progress is unfortunately slow.
Concerning Grid: I got mycertificate. I've been keeping notes while doing it, so if someone needs it I'll gladly send them. Of course they are UW-Madison oriented but should work for any CMS person with few changes.
PROOF: I finally managed to create a TSelector for CMSSW root files! I've been trying to use the root files I had around from the summer, or some test root files that I created with CMMSW_1_1_0. The script I was using until now was dropping most of the branches and kept very specific stuff. Now, since the plan is to start looking at RCT stuff as well, we created some files with all the branches kept. I thought to give it one more try and this time it worked!
Jessica gave us a small intro to the RCT code. Now I'll have to start looking at it myself as well an play with it :)
Edited on: Wednesday, May 09, 2007 12:38 PM
Categories: Programming, Root
Tuesday, August 08, 2006
To sum up...
Final entry (until I resume work!). Let's put everything that's been done this summer together...
We'll have to start by creating an area for our project. If our version of CMSSW is, say, 0_8_0, then we'll have to write:
scramv1 project CMSSW CMSSW_0_8_0;
To checkout code from the repository:
cd CMSSW_0_8_0/src;
cmscvsroot CMSSW; cvs login;
cvs co -r CMSSW_0_8_0 IOMC;
Inside the IOMC/GeneratorInterface/test we can find some examples of event generation. Before doing anything like this though, we'll have to do:
cd IOMC/GeneratorInterface/test;
eval `scramv1 runtime -sh`; Needed after logon to run a project.
cmsRun mcinput.cfg; Generate events.
To study a certain process you need to change the parameters that are being sent to Pythia. For the example code, these are located in IOMC/GeneratorInterface/data inside the .cfi files. Setting MSEL=0 allows you to define your own processes. Then, you'll have to use MSUB to choose processes and, if desired, MDME values to turn on or off decay channels. More information about these can of course be found in the Pythia manual.
Now, after generating some events you'll want to process them I suppose. There are two ways to do this:
- Using ROOT and FWLight
- Using the Full Framework
For FWLight, you'll have to load all the necessary tools after starting ROOT:
gSystem->Load("libFWCoreFWLite.so");
AutoLibraryLoader::enable();
The full framework gives you full control (and probably less frustration!). You'll have to create a directory for your analysis and create an empty analyzer project which you'll use as a template to do all the real work:
After logging in your account then you can do:
cd CMSSW_0_8_0/src
eval `scramv1 runtime -sh`
mkdir Analysis
mkedanlzr Analyzer
Now you can change the Analyzer.cc in the Analysis/Analyzer/src directory to do whatever you want to do. I have put online my code (not final version). After Aug. 15th I'll put online the "final" versions as well as a reference. A useful "recipe" from Sasha Nikitenko can be found here. Other useful pages can be found in the sidebar (-->) .All the presentations I've put in the files section could be useful. Also, in previous postings there are information about how to iterate over SuperClusters or other parts of the resulting root files and how to extract information from them.
Now a good part of this summer was (well) spent on trying to deduce a good electron-finding technique. The following cuts seem to work nicely:
- Min SC energy cut = 5.0 GeV
- Max SC energy cut = 300.0 GeV
- ΔR between SCs & Jets >= 0.5
- E ratio between SCs & Jets >= 0.3
- ΔR between Tracks & SCs = 0.5
- E/Pt between Tracks & SCs >= 0.7
Also, the current version of CMSSW seems to have some issues with the EndCap SuperClusters (look at previous post and the August 1st presentation).
You may also find my final presentation interesting (tba).
Edited on: Wednesday, September 27, 2006 1:57 PM
Categories: CMSSW, Linux, Physics, Programming, Root
Thursday, July 13, 2006
first analysis steps (on tracks, SCs, jets)
So, today we've been collaborating with Marc and we were trying to start writing some analysis code and delve into the secrets of Tracks, SuperClusters (SCs) and Jets :)
What we accomplished is:
- We started building on a generic script I've prepared with pointers at the trees: recoTracks_CTFWMaterial, recoSuperClusters_islandSuperClusterProducer_islandBarrelSuperClusterCollection and CaloJets_mcone5. The respective pointers are of type: std::vector<reco::Track>, std::vector<reco::SuperCluster> and std::vector<CaloJet>.
- We've calculated eta, phi and energy for Tracks, SCs and Jets. For Tracks, because eta, phi were not directly available we used a ROOT TLorentzVector as Prof. Dasu proposed and used that to find eta and phi from the methods: vector.eta() and vector.phi().
- Used etas and phis to find Delta(r) between tracks&SCs and SCs&Jets.
- Also, we've calculated the ratio of {Ecal/(Ecal+Ehcal)}. Currently I'm running an analysis to create this plot to see how it looks - one hour and a half and counting so far...
After 2 hours and some minutes... we have this. Before you get too baffled, let me tell you this: only SCs&Jets with Delta(r)<=0.3 were adder to the plot. I plan to plot all of them pretty soon.
Edited on: Thursday, July 13, 2006 7:10 PM
Categories: CMSSW, Root
Wednesday, July 12, 2006
Tracks, Clusters, SuperClusters and Jets
So far, I've created three analysis scripts to process the reconstructed Tracks, SuperClusters and Jets. They're pretty crude scripts, no eta, phi or Delta(r) selection is being made. As soon as these are working as I need to, if there is time I'll try to instegrate them as modules to the full CMSSW framework.
I've got a couple of histograms (analysis still running): DiJetMass, LeadingJetsEta, LeadingJetsPhi, LeadingJetsPt.
Analysis finished: Plots, Scripts, Presentation.
Edited on: Thursday, July 13, 2006 10:24 AM
Categories: CMSSW, Root
Monday, July 10, 2006
Notes on Analyzer.cc
Analyzer.cc has a special interest because it is the first example of EDAnalyzer (analysis with the full framework and not FWLight).
First let's note that in the cfg file, the following strings are passed to the Analyzer:
string calotowers = "caloTowers"
string tracks = "CTFWMaterial"
string jets = "icone5"
string jetsgen = "icone5gen"
These apparently are the root file branches that contain the information he's looking for. These are later passed to the module at the constructor:
// get names of modules, producing object collections
m_tracksSrc = iConfig.getParameter<string>("tracks");
m_jetsSrc = iConfig.getParameter<string>("jets");
m_jetsgenSrc = iConfig.getParameter<string>("jetsgen");
m_calotowers = iConfig.getParameter<string>("calotowers");
Now, at the actual analysis code we have the definitions (after a using namespace edm statement):
Handle<HepMCProduct> evt; MC info Handle<CaloTowerCollection> calotowers; calo towers collection Handle<CaloJetCollection> jets; calo jet collection Handle<GenJetCollection> jetsgen; calo jet collection Handle<TrackCollection> tracks; track collection
Then, there's an iteration over the number of jetsgen where the Jets Pt, eta and phi are printed out and hJetEt->Fill((*jetsgen)[j].pt()); fills the Et histogram. The eta and phi histograms are filled outside this loop with:
hJetEta->Fill((*jetsgen)[0].eta(),(*jets)[1].eta());
hJetPhi->Fill((*jetsgen)[0].phi(),(*jets)[1].phi());
I'll have to look a bit more at this last part; it confuses me a bit.
Edited on: Monday, July 10, 2006 2:46 PM
Categories: CMSSW, Root
Sunday, July 09, 2006
Some code cleanup and results from Nikitenko's recipe using condor and my signal cfi.
Cleaned up a bit my root scripts. Started some preliminary processing of the Signal job I submitted to condor somedays ago. 9973 events made it to the end. I'll have to look at the error messages to see what happened.
The jobs I submitted using Nikitenko's recipe to condor (my signal cfi) seems it worked fine - at least I have root files this time. I processed one of them with the Analyzer script and got plots for JetEt, JetEta and JetPhi. By the way, the modified version of the script to submit condor jobs using this recipe and 0_8_0_pre2 is in my /bin directory under the name farmoutFullCMS080SimulationJobs.
Wednesday, July 05, 2006
July 5
1. Found out something very interesting today... the Pythia seed has to be between 0 and 900000000. Setting it to a larger number resets it to -1. That's why all our root files had the same events...
2. I really don't know if this is a Root issue or Cint or just my fault. When trying to TChain some files for further processing with a script named ChainTest.C:
void ChainTest(const char* fName =
"some_filename")
{
gSystem->Load("libFWCoreFWLite.so");
AutoLibraryLoader::enable();
TChain
*chain = new TChain("Events");
chain->Add(fNames);
chain->GetEntries();
chain->GetEvent(0);
...
}
During execution at the GetEvent line I get the error message:
Error: Symbol chain is not defined in current
scope
CPlotElectronsTest.C:21:
Error: Failed to evaluate
chain->GetEvent(0)
I was using the exact same script to process my previous root files. The difference is that the first contained only generated particles whereas the second digitized events. In the first case works fine!
If the script is modified as:
{
const char* fName = "some_filename");
gSystem->Load("libFWCoreFWLite.so");
AutoLibraryLoader::enable();
TChain
*chain = new TChain("Events");
chain->Add(fNames);
chain->GetEntries();
chain->GetEvent(0);
...
}
Everything works perfectly for both root files! If a solution is found I'll post it here as well.
Edited on: Thursday, July 06, 2006 12:27 PM
Categories: CMSSW, Root
Thursday, June 29, 2006
June 28
Worked on the TChain-ing correctly the root files. Our previous FWLight scripts were producing seg. faults when trying to access the events. I found this page in the CMS TWiki:
https://uimon.cern.ch/twiki/bin/view/CMS/WorkBookJetReco#FWLite_with_TChain
and used the method described in the files analyzeJets_headChain.C and analyzeJetsChain.C. My (final?) version of the root script looked like:
gSystem->Load("libPhysicsToolsFWLite");
AutoLibraryLoader::enable();
TChain chain("Events");
chain->Add(filenames);
// Number of entries in chain
Int_t nevent = chain.GetEntries();
// Open first file and set addresses. This needed in addition to what is done in event loop.
chain.GetEvent(0);
// Declare HepMCProduct
edm::HepMCProduct prod;
chain.SetBranchAddress("edmHepMCProduct_PythiaSource__TEST.obj",&prod);
int treenumber = 0;
double p_mom, p_eta, p_id;
// Loop over events
for ( int ev = 0; ev < nevent; ++ev )
{
// Begin magic from Phillipe Canal to insure that for each file
// we read the first entry twice. Necessary, for the chain to work.
int current = chain.LoadTree(ev);
if (treenumber!=current)
{
chain.GetEvent(ev);
chain.SetBranchAddress("edmHepMCProduct_PythiaSource__TEST.obj",&prod);
treenumber = current;
}
// End magic from Phillipe Canal.
chain.GetEvent(ev);
// Iterate over the particles of the current event
for (HepMC::GenEvent::particle_const_iterator p = prod.getHepMCData().particles_begin(); p != prod.getHepMCData().particles_end(); ++p ) {
(...) // particle iteration loop
} // End current event loop
} // End iteration over events.
Executing this script gives warnings like this:
Error in <TTree::SetBranchStatus>: unknown branch -> edmHepMCProduct_PythiaSource__TEST.obj
The number of the warnings is as much as the number of root files we have TChained (edit: warnings are #files-1). With tests that have been made so far though, it doesn't seem to affect our histograms.
Note: The above is for CMSSW 0_6_0. Moving to 0_7_2 will probably require to use gSystem->Load("libFWCoreFWLite.so"); instead.
Edited on: Thursday, June 29, 2006 12:24 PM
Categories: Programming, Root
Monday, June 26, 2006
June 26
Not much to say... I've been trying to make my root scripts more elaborate.
I have an updated version of the Powerpoint presentation (some plots have finally Et removed). The PlotCombined root script now plots each background set with a different color (e+e-, neutrinos). Also, the scaling of the graphs changed slightly. Now to do the scaling, the sum of the cross sections of each set is being used times the number of events.
Edited on: Monday, June 26, 2006 6:15 PM
Categories: CMSSW, Physics, Root
Monday, June 19, 2006
Week 3
June 23
Created 2 highest Pt e+e- plots. Signal,
Background Set
1, Set
2, Top,
Drell-Yan.
*
Script
stops searching @50th particle to save time.
Finished(?) script to produce combined signal/background plots. Will be online during the weekend hopefully.
Powerpoint presentation with the progress so far (under development!)
June 22
Started producing background plots. Plotted all background sets separately. (until I get organized better look at my files)
Plotted the highest Pt electrons for the signal.
Work in progress: Script to plot signal+background together.
Scaling of the histograms: Multiplication of the cross section given by Pythia times the number of events.
TODO: 1) Plot 2 highest Pt electrons. 2) Remove Et from graphs - keep only Pt (DONE - new plots will be ok).
June 20
Looking for background processes in Pythia... current selection:
'MSUB(12)=1 ! fi fibar -> fk fkbar',
'MSUB(15)=1
! fi fibar -> g Z0',
'MSUB(16)=1 ! fi fjbar -> g W+',
'MSUB(22)=1
! fi fibar -> Z0 Z0',
'MSUB(23)=1 ! fi fjbar -> Z0 W+',
'MSUB(25)=1
! fi fibar -> W+ W-',
'MSUB(30)=1 ! fi g -> fi Z0',
'MSUB(31)=1
! fi g -> fk W+',
'MSUB(81)=1 ! fi fibar -> Qk Qkbar',
'MSUB(82)=1
! gg -> Qk Qkbar',
'MSUB(84)=1 ! g gamma -> Qk Qkbar'
June 19
So, the Drell-Yan process is the collision between two quarks giving a virtual photon and subsequently a lepton and an antilepton pair as a product.
Quoting this paper (Phys. Rev. Lett. 56, 1327), my process, a Z with larger transverse momentum opposite a missing transverse momentum of the same size, has litte background in the SM.
Notes:
K-factor: The fraction (NLO cross section)/(LO
cross section) --- NLO: Next Leading Order
Edited on: Saturday, June 24, 2006 7:28 PM
Categories: CMSSW, Physics, Root
Thursday, June 15, 2006
Week 2
* Final selection of process: Higgs -> ZZ -> eeνν
- Find and set Pythia parameters to produce the above process.
Parameter selection so that only the Higgs->ZZ process exists. Also, Added constraints so that one of the Zs decays to e+e- and the other to (any) two neutrinos.
- Using root scripts ploting Etran, Ptran and eta (for electrons/positrons and neutrinos)
Currently at the stage of identifying background processes. t-tbar and the Drell-Yan process (?->look it up!) important backgounds.
Root notes:
Getting the events from the root file:
TTree* events = (TTree*) (f.Get("Events"));
TBranch*
MCBranch = events->GetBranch("edmHepMCProduct_PythiaSource__TEST.obj");
edm::HepMCProduct
prod;
MCBranch->SetAddress(&prod);
To iterate over all particles in a root file:
for (HepMC::GenEvent::particle_const_iterator
p = prod.getHepMCData().particles_begin();
p !=
prod.getHepMCData().particles_end(); ++p )
{
...
}
Useful properties of particles:
(*p)->ParticleID(); What
particle are we dealing with?
(*p)->momentum().perp();Transverse
component of momentum
(*p)->momentum().eta();Pseudorapidity
(*p)->momentum().et();Transverse
energy
(*p)->momentum().Mother();The
mother of the particle
Edited on: Monday, June 19, 2006 2:48 PM
Categories: CMSSW, Physics, Root
Week 1
A small roundup of what happened the first week...
- Selected a Higgs decay channel (higgs -> ZZ -> llνν).
- Setting up a CMSSW project to work with...
scramv1 project CMSSW CMSSW_0_6_0;
cd
CMSSW_0_6_0/src;
- Checking out code from the CSSSW repository using cvs:
cmscvsroot CMSSW; cvs login;
cvs co -r
CMSSW_0_6_0 IOMC;
cd IOMC/GeneratorInterface/test;
eval
`scramv1 runtime -sh`; Needed after logon to run a project.
cmsRun
mcinput.cfg; Generate events.
- Learned how to setup a process is CMSSW, by changing MSUB (processes), MDME (decays) values.
- Creating Root scripts to plot transverse energy/momentum and eta of particles.
Very useful: Filip Moortgat's presentation on Generator Interface in CMSSW.
Also, attended the June 7th CMSSW tutorial. And here's the workbook of the tutorial.
Edited on: Friday, June 16, 2006 3:45 PM
Categories: CMSSW, Linux, Root