Comments (7)
Hi Antoine ,
First of all be sure that in your unpacking macro you are calling the reader that unpacks TPat information :
source->AddReader(new R3BTrloiiTpatReader(
&ucesb_struct.unpacktpat, offsetof(EXT_STR_h101, unpacktpat)));
Then get it in a proper way in your analysis macro ,
TBranch *tpatBranch = eventTree->GetBranch("EventHeader.");
R3BEventHeader *fEventHeader;
tpatBranch->SetAddress(&fEventHeader);
and read it in the main event loop :
Int_t fTpat, tpatbin;
if (fEventHeader->GetTpat() > 0)
{
for (Int_t i = 0; i < 16; i++)
{
tpatbin = (fEventHeader->GetTpat() & (1 << i));
if (tpatbin != 0){
fTPat=i+1;
}
}
cout<<"TPat for event "<<j<<" : "<<fTPat<<endl;
Hope this helps.
from r3broot.
Thank you for your answer.
The unpacker was already fine (path =/u/land/r3broot/202205_s522/R3BParams_S522/macros/exp/unpack/unpack_data.C ) and my macro, after adding your lines, doesnโt crash anymore but the Tpat values returned by fEventHeader->GetTpat() are never > 0 but still = -1382216307 , so I couldn't enter in the loop you gave me.
However, if I draw the EventHeader.fTpat from the terminal I see several values...
(if someone want to use these lines, there is a little mistake: GetBranch("EventHeader**.**"); => GetBranch("EventHeader");
from r3broot.
In fact the branch must be called with the dot GetBranch("EventHeader.");
, as this is how it appears in the root tree (it inherits from FairEventHeader, check https://github.com/FairRootGroup/FairRoot/blob/master/base/event/FairEventHeader.cxx). Try now and if its not working please write here the file you are using, so we can reproduce your error.
from r3broot.
Actually, I removed this dot because when I used it, my macro crashed when it reached "tree->GetEntry(i)", right at the beginning of my loop.
I use the following macro:
/u/land/r3broot/202205_s522/foot/macros/offline/WorkingDir/Antoine/analysis_Antoine_Gsi.C
(the root file are in the same folder)
Thank you in advance for your help.
from r3broot.
Hi, just put in that folder a couple of macros, the one you sent working and other one with general procedures for tpat analysis. I did not see anything wrong about the way you were getting the tpats but it was crashing, so I just rewrite the same stuff and it started working (I suppose there were some extra stuff coming from copying -pasting.... this I have to check ). Anyways, some remarks :
- /u/land/r3broot/202205_s522/ is a place for parameter development and tracing. User stuff should be placed on your folder in land and then commited to this repository (but definitely not in a folder called "Antoine". I can send you the proper scheme for this repository)
- I saw some .dat files with pedestals. This pedestals should go in a .par file that is loaded to fill a proper container. Please do not use .dat files or similar to hardcode parameter management.
- As a general recommendation : clear TCloneArray at the beggining of the eventloop (FootMappedData, in your case)
If you need help please don't hesitate to ask.
from r3broot.
Thank you again for your help.
I ran the macro with your changes and it crashed, but by adding the two lines you used in tpat_study.C it finally works.
I deleted these two lines from tpat_study.C and it crashed as well.
They were these:
eventTree->SetBranchStatus("*",0);
eventTree->SetBranchStatus("EventHeader.*",1);
(before the TBranch line)
Regarding your remarks (1 and 2), during the analysis meetings organized by Valerii Panin, we were made aware of it.
I use the .dat file (there is also a .par file in the folder) and I work in this folder only during the test phase.
from r3broot.
In principle this should not be necessary
eventTree->SetBranchStatus("*",0); eventTree->SetBranchStatus("EventHeader.*",1);
as they have to be on when you open a root tree. I will take a look to this.... maybe is related to what is happening to @ManuelXarepe
from r3broot.
Related Issues (20)
- UCESB cannot populate items in client_struct_info with client.setup HOT 2
- Handling new vs old experiment Readers/code HOT 1
- Clang-tidy setting HOT 24
- Design Guidelines for R3BRoot HOT 1
- Unknown Type name 'FairMCTracks' HOT 1
- Error in <TExMap::Add>: key is not unique HOT 1
- Clang-formatting - what should be included, what should be removed, future additions HOT 10
- File to generate Hit Parameters using Los not in GitHub repository HOT 5
- Proposal to remove ext files from dev branch HOT 19
- Bug CALIFA QPID Simulation HOT 4
- Forbid pull requests from the dev branch? HOT 6
- Spell fixes by `codespell` HOT 3
- FATAL error in unpacker HOT 4
- Auto-generated ext_h101 structs HOT 3
- Policy discussion: on pull requests, merging and reviews HOT 12
- Unknown CMake command "fair_pad" HOT 2
- Added new repository for lmds and analysis CI tests HOT 2
- About clang-tidy and code standard HOT 11
- Problems with the compilation of new reader data structures: TTTX HOT 4
- [Proposal] Metadata file for experiments? HOT 24
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r3broot.