void runTask ( TString runMode, TString analysisMode, TString inputName, TString inputOptions = "", TString softVersions = "", TString analysisOptions = "", TString taskOptions = "" ) { gROOT->LoadMacro(gSystem->ExpandPathName("$TASKDIR/runTaskUtilities.C")); // This setpus the analysis: i.e. loads needed libs, creates the manager SetupAnalysis(runMode,analysisMode,inputName,inputOptions,softVersions,analysisOptions, "libPWGPPMUONlite.so","$ALICE_ROOT/include $ALICE_PHYSICS/include"); Bool_t isMC = IsMC(inputOptions); // Add here your tasks gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTaskMTRchamberEfficiency.C"); AliAnalysisTaskTrigChEff* task = AddTaskMTRchamberEfficiency(isMC); // This starts the analysis StartAnalysis(runMode,analysisMode,inputName,inputOptions); }
//ProcessOne() takes a track, transforms it to bunch of buffer-blocks, //and executes AnalyzeData, then ProcessData, on it... bool EffectNormalize::ProcessOne(WaveTrack * track, sampleCount start, sampleCount end) { bool rc = true; sampleCount s; //Get the length of the buffer (as double). len is //used simple to calculate a progress meter, so it is easier //to make it a double now than it is to do it later double len = (double)(end - start); //Initiate a processing buffer. This buffer will (most likely) //be shorter than the length of the track being processed. float *buffer = new float[track->GetMaxBlockSize()]; int pass; for(pass=0; pass<2; pass++) { if(pass==0 && !mDC) // we don't need an analysis pass if not doing dc removal continue; if (pass==0) StartAnalysis(); // dc offset only. Max/min done in Process(). if (pass==1) StartProcessing(); //Go through the track one buffer at a time. s counts which //sample the current buffer starts at. s = start; while (s < end) { //Get a block of samples (smaller than the size of the buffer) sampleCount block = track->GetBestBlockSize(s); //Adjust the block size if it is the final block in the track if (s + block > end) block = end - s; //Get the samples from the track and put them in the buffer track->Get((samplePtr) buffer, floatSample, s, block); //Process the buffer. if (pass==0) AnalyzeData(buffer, block); if (pass==1) { ProcessData(buffer, block); //Copy the newly-changed samples back onto the track. track->Set((samplePtr) buffer, floatSample, s, block); } //Increment s one blockfull of samples s += block; //Update the Progress meter if (TrackProgress(mCurTrackNum, ((double)(pass)*0.5) + // Approximate each pass as half. ((double)(s - start) / (len*2)))) { rc = false; //lda .. break, not return, so that buffer is deleted break; } } } //Clean up the buffer delete[] buffer; //Return true because the effect processing succeeded ... unless cancelled return rc; }