Open meena91 opened 1 week ago
Hi Meena.
I do not understand what you are trying to do... Can you please be a bit more explicit. Thanks in advance. In principle, you are supposed to list all the paths to the root files in the input file, and MA5 will take care of the rest.
Cheers,
Benjamin
Dear Benjamin, I want to run sampleAnalyzer on multiples file and need different output files corresponding to each input files. But with the current above script, I am able to get different root files corresponding to each input files but size of the all files are same or events are same in all output files for same histogram. Yes, I am giving list of all input files (with path) in .txt files.
Hopefully now I am clear, if not please let me know.
Thank you in advance, Meena
Hi Meena,
I want to run sampleAnalyzer on multiples file and need different output files corresponding to each input files. But with the current above script, I am able to get different root files corresponding to each input files but size of the all files are same or events are same in all output files for same histogram. Yes, I am giving list of all input files (with path) in .txt files.
In this case, all event files are combined into a single output file. If you want one output file per event file, you need to run MA5 on different input files, each of them containing the path to one single event file.
I hope it helps.
Cheers,
Benjamin
Dear Benjamin,
Thank you for your reply. you mean I can kept only one .root file in one .txt file and 2nd root file in 2nd .txt file to get different output files.
Best Regards, Meena
Precisely.
Cheers,
B>
On 15 Nov 2024, at 09:50, meena91 @.***> wrote:
Dear Benjamin,
Thank you for your reply. you mean I can kept only one .root file in one .txt file and 2nd root file in 2nd .txt file to get different output files.
Best Regards, Meena
— Reply to this email directly, view it on GitHub https://github.com/MadAnalysis/madanalysis5/issues/273#issuecomment-2478257639, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIWJNJZWEP3EGU24VKH5RBL2AWYUVAVCNFSM6AAAAABRZXTIKOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZYGI2TONRTHE. You are receiving this because you commented.
Question
Dear Expert, I tried below method to run on multiple files at one time, I am getting different root files but size and events are same in both root files. Command to Run .ccp file is ./MadAnalysis5job input_files.txt. Where input_files.txt has name of root files.
Could you please help me in this case?
bool ALP::Initialize(const MA5::Configuration& cfg, const std::map<std::string,std::string>& parameters) { gamma_size_gen_FSR= new TH1F("gamma_size_gen_FSR","",21,-0.5,20.5);
cout << "END Initialization" << endl; return true; }
void ALP::Finalize(const SampleFormat& summary, const std::vector& files)
{
const std::string outputDirectory = "output_files"; // Loop over all input files for (size_t i = 0; i < files.size(); ++i) {
const SampleFormat& file = files[i];
gamma_size_gen_FSR->Write();
bool ALP::Execute(SampleFormat& sample, const EventFormat& event) { std::vector<const MCParticleFormat> gamma_FSR; if (event.mc()!=0) { for (MAuint32 i = 0; i < event.mc()->particles().size(); i++) { const MCParticleFormat part = &(event.mc()->particles()[i]); // Access particle gamma_FSR.push_back(part); gamma_size_gen_FSR->Fill(gamma_FSR.size(),wgt); }} }