« Physics | Main | Root »

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 :)

Posted by Christos Lazaridis at 2:02 PM
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).

Posted by Christos Lazaridis at 12:08 PM
Edited on: Wednesday, September 27, 2006 1:57 PM
Categories: CMSSW, Linux, Physics, Programming, Root

Monday, July 17, 2006

Full framework progress

I started following the same technique as with FWLight: Built successfully iterators to go through all the tracks, SCs and jets of an event. Instead of using nested iterators (jets inside SCs for example) what I do now is I created vectors where Jet and Track info are being stored. Then this information is being used at the SC iterator. Still we need double loops, but the nested one doesn't access the root file anymore, but the memory. I hope this will speed things up significantly. Sample of struct used:

struct JetData
{
unsigned int number;
double eta;
double phi;
double energy;}

Tomorrow's todo: Add histograms; maybe create a FWLight script to combine the resulting root files if time permits.

Posted by Christos Lazaridis at 9:26 PM
Edited on: Monday, July 17, 2006 9:27 PM
Categories: CMSSW, Programming

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.

Posted by Christos Lazaridis at 11:10 AM
Edited on: Thursday, June 29, 2006 12:24 PM
Categories: Programming, Root

Christos Lazaridis - My other website :)