Expected Expression error

Hey,

I am encountering a very surprising error in my ROOT code. I have attached the error and C++ file.

Appreciate any help on this.

input_line_29:3:1: error: expected expression
;}
^
Error in <TRint::HandleTermInput()>: std::runtime_error caught:
RDataFrame: An error occurred during just-in-time compilation. The lines above might indicate the cause of the crash
 All RDF objects that have not run an event loop yet should be considered in an invalid state.
#include "ROOT/RDataFrame.hxx"
#include "TFile.h"
#include "TCut.h"
#include <vector>
#include <iostream>

void make_RawTuples_data(TString Input, TString OutputBase)
{
	ROOT::EnableImplicitMT(); // Allow for multi threading and parallel processing
	Input += "/Tuple_*.root";

	// Putting all the data in RDataFrame
	ROOT::RDataFrame df("XYZ/DecayTree", Input);

	cout << "Input path: " << Input << endl;

	TString outputFileName = "../root/data_";

	outputFileName  += OutputBase + "_RawTuples.root"; // Defining the output root file format

	// Define the first stage of trigger cuts for B meson
	TString cut_l0 = "( B_L0HadronDecision_TOS==1 || B_L0Global_TIS==1 ) && ";
	TString cut_h1 = "( B_Hlt1TrackMVADecision_TOS==1 || B_Hlt1TwoTrackMVADecision_TOS==1 || B_Hlt1TrackAllL0Decision_TOS ==1 ) && ";
	TString cut_h2 = "( B_Hlt2Topo2BodyBBDTDecision_TOS==1 || B_Hlt2Topo3BodyBBDTDecision_TOS==1 || B_Hlt2Topo4BodyBBDTDecision_TOS==1 || B_Hlt2Topo2BodyDecision_TOS==1 || B_Hlt2Topo3BodyDecision_TOS==1 || B_Hlt2Topo4BodyDecision_TOS==1) &&";
	TString cut_trg = cut_l0 + cut_h1 + cut_h2;

	// This cut has ben added in the precut step
	// TString cut_mass = "( D_M<2000 && D_DIRA_ORIVX>0 )";

	TString cut_data;
	cut_data += cut_trg;
	//cut_data += cut_mass;

	cout << "Output file name: " << outputFileName << endl;

	df.Filter(cut_data.Data()).Snapshot("DecayTree", outputFileName.Data());	
}

I am using 2 bash files also to run the cpp file but I doubt that they have an error.

Hi @amishgog,
thanks for reaching out! Can you provide the full error output please?
Cheers,
Monica

Hey Monica,

That is the full error.

array_samples=("2011_MU" "2011_MD" "2012_MU" "2012_MD" "2015_MU" "2015_MD" "2016_MU" "2016_MD" "2017_MU" "2017_MD" "2018_MU" "2018_MD")

numyear=${#array_year[@]}
nummode=${#array_samples[@]}

lb-conda default root -l --web=off -b  << EOF
.L make_RawTuples_data.C+
EOF

for((ii=0;ii<$nummode;ii++))
do 
#========================================================================
#========================================================================

Input1="${array_year[$ii]}"
Input2="${array_samples[$ii]}"
echo "------------------------"
echo "Submit ${Input1} ${Input2}"
./parse_make_RawTuples_data.sh  ${Input1} ${Input2} 

echo ""
#========================================================================
#========================================================================
done 

rm *.d
rm *.pcm
rm *.so

This is one bash file and

Input=${1}
Output=${2}

echo "------------------------"
echo "Cleaning ${Input}"
echo "Cleaning ${Output}"

lb-conda default root -l --web=off -b  << EOF
.L make_RawTuples_data_C.so
make_RawTuples_data("${Input}", "${Output}")
EOF
echo "Done ${Input}"
echo "Done ${Output}"

This is the other bash file

Ok, could you then provide your input file so I can reproduce?

I am actually working on a cluster at EPFL so I won’t be able to send you the files.

I think the problem maybe with JIT. I found this very old issue but it was resolved [DF] Wrong regex substitution when generating code to jit · Issue #11002 · root-project/root · GitHub

There probably is a typo in your expression… what if you use only one of the cuts?

Let me check

Nope, still the same error.

Its not a wildcard expression issue as well, since I checked by hardcoding the input filename as well

What ROOT version are you using? Are you able to isolate the error, i.e. to reproduce it on some input data without using your bash scripts? If you could replicate your error on dummy data you can upload I could help you better

ROOT version is 6.32.02

Unfortunately even one of the Raw tuples is too big to upload here and I don’t have any dummy data.

I uploaded one of the files in cern box maybe you can access it from there:

https://cernbox.cern.ch/s/zAgvUSP2tJBLAEM

I downloaded the file, but I don’t see any dataset XYZ/DecayTree. This is the content:

TFile**		Tuple_92.root	Gaudi Trees
 TFile*		Tuple_92.root	Gaudi Trees
  KEY: TDirectoryFile	B2Dpppi;1	B2Dpppi
  KEY: TDirectoryFile	GetIntegratedLuminosity;1	GetIntegratedLuminosity

Ahh my apologies yes the DecayTree is “B2Dpppi/DecayTree”

The problem is that you have an extra && at the end of cut_h2, if you remove it it will execute smoothly

Oh wow. I have totally missed that. Thank you so much for all the help Monica. Spent too much time on this than I should have :slight_smile: