<commit_before>#if !defined(__CINT__) || defined(__MAKECINT__)
#include <TApplication.h>
#include <TGClient.h>
#include <TGButton.h>
#include <TGFrame.h>
#include <TGLayout.h>
#include <TGWindow.h>
#include <TGLabel.h>
#include <TGNumberEntry.h>
#include <TString.h>
#include <TCanvas.h>
#include <TStyle.h>
#include <TPad.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TF1.h>
#include <TSystem.h>
#include <TGraph.h>
#include <TLatex.h>
#include <TLine.h>
#include <TROOT.h>
#endif

// Macro to display the output of SDD calibration runs
// -> copies the ASCII files with the DA output from the LDC
// -> plot various histograms and graphs
// Origin: <NAME> (<EMAIL>)

class CheckCalibInterface : public TGMainFrame {

private:
  TGCompositeFrame    *fHor1;
  TGCompositeFrame    *fHor2;
  TGCompositeFrame    *fHor3;
  TGCompositeFrame    *fHor4;
  TGTextButton        *fCopyFiles;
  TGTextButton        *fShowPedest;
  TGTextButton        *fShowPulser;
  TGTextButton        *fShowInject;
  TGTextButton        *fShowOneMod;
  TGTextButton        *fExit;
  TGGroupFrame        *fGframeALL;
  TGGroupFrame        *fGframeSING;
  TGGroupFrame        *fGframe1;
  TGGroupFrame        *fGframe2;
  TGNumberEntry       *fDDL;
  TGNumberEntry       *fChannel;
  Int_t fNumDDL;
  Int_t fNumChannel;

public:
  CheckCalibInterface(const TGWindow *p, UInt_t w, UInt_t h);
  virtual ~CheckCalibInterface();
  void DoSetlabel();

  static void CopyFiles();
  static void ShowPedestal();
  static void ShowPulser();
  static void ShowInjector();
  static void ShowSingleModule(Int_t iddl, Int_t ichan);
  static void ClearAll();

  ClassDef(CheckCalibInterface, 0)
};
                          
CheckCalibInterface::CheckCalibInterface(const TGWindow *p, UInt_t w, UInt_t h)
   : TGMainFrame(p, w, h)
{

  fHor1 = new TGHorizontalFrame(this);
  fHor2 = new TGHorizontalFrame(this);
  fHor3 = new TGHorizontalFrame(this);
  fHor4 = new TGHorizontalFrame(this);

  TGLayoutHints *lh=new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
  TGLayoutHints *lhc=new TGLayoutHints(kLHintsCenterY | kLHintsExpandY, 5, 5, 5, 5);
  TGLayoutHints *lh1=new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5);

  fCopyFiles = new TGTextButton(fHor1, "&Copy Files", "CheckCalibInterface::CopyFiles()");
  fHor1->AddFrame(fCopyFiles, lh1);

  fGframeALL = new TGGroupFrame(fHor2,"All Modules",kHorizontalFrame);
  fShowPedest = new TGTextButton(fGframeALL, "&Show Pedestal","CheckCalibInterface::ShowPedestal()");
  fShowPulser = new TGTextButton(fGframeALL, "&Show Pulser","CheckCalibInterface::ShowPulser()");
  fShowInject = new TGTextButton(fGframeALL, "&Show Injector","CheckCalibInterface::ShowInjector()");    
  fGframeALL->AddFrame(fShowPedest, lh1);
  fGframeALL->AddFrame(fShowPulser, lh1);
  fGframeALL->AddFrame(fShowInject, lh1);
  fHor2->AddFrame(fGframeALL, lh1);

  fGframeSING = new TGGroupFrame(fHor3,"Single Module",kHorizontalFrame);
  fGframe1 = new TGGroupFrame(fGframeSING, "DDL");
  fDDL = new TGNumberEntry(fGframe1, 0, 2,-1, TGNumberFormat::kNESInteger,
			   TGNumberFormat::kNEANonNegative, 
			   TGNumberFormat::kNELLimitMinMax,
			   0, 23);
  fGframe2 = new TGGroupFrame(fGframeSING, "Channel");
  fChannel = new TGNumberEntry(fGframe2, 0, 2,-1, TGNumberFormat::kNESInteger,
			       TGNumberFormat::kNEANonNegative, 
			       TGNumberFormat::kNELLimitMinMax,
			       0, 11);
  fGframe1->AddFrame(fDDL,lh);
  fGframe2->AddFrame(fChannel,lh);
  fGframeSING->AddFrame(fGframe1,lh);
  fGframeSING->AddFrame(fGframe2,lh);
  
  fDDL->Connect("ValueSet(Long_t)", "CheckCalibInterface", this, "DoSetlabel()");
  (fDDL->GetNumberEntry())->Connect("ReturnPressed()", "CheckCalibInterface", this, "DoSetlabel()");
  
  fChannel->Connect("ValueSet(Long_t)", "CheckCalibInterface", this, "DoSetlabel()");
  (fChannel->GetNumberEntry())->Connect("ReturnPressed()", "CheckCalibInterface", this, "DoSetlabel()");
  fHor3->AddFrame(fGframeSING, lh1);
  
  fShowOneMod = new TGTextButton(fGframeSING, "&Show Selected Module","CheckCalibInterface::ShowSingleModule(0,0)");
  fGframeSING->AddFrame(fShowOneMod, lhc);

  fExit = new TGTextButton(fHor4, "&Exit", "gApplication->Terminate(0)");
  fHor4->AddFrame(fExit, lh1);

  AddFrame(fHor1,lh1);
  AddFrame(fHor2,lh1);
  AddFrame(fHor3,lh1);
  AddFrame(fHor4,lh1);

  SetCleanup(kDeepCleanup);
  SetWindowName("Main Control");
  MapSubwindows();
  Resize(GetDefaultSize());
  MapWindow();
}

CheckCalibInterface::~CheckCalibInterface()
{
   // Destructor.
   
   Cleanup();
}


void CheckCalibInterface::CopyFiles(){
  //
  TString command;
  TString ldcName[6]={"aldaqpc083","aldaqpc084","aldaqpc041",
		      "aldaqpc082","aldaqpc085","aldaqpc086"};
  gSystem->Exec("rm -rf calibFiles");
  gSystem->Exec("mkdir calibFiles");
  for(Int_t iLDC=0; iLDC<6; iLDC++){
    Int_t firstDDL=iLDC*4;
    Int_t lastDDL=iLDC*4+3;
    command.Form("scp %s:/dateSite/ldc-SDD-%02d-%02d-0/work/SDDbase_step2_LDC.tar calibFiles/.",ldcName[iLDC].Data(),firstDDL,lastDDL);
    gSystem->Exec(command.Data());
    command.Form("scp %s:/dateSite/ldc-SDD-%02d-%02d-0/work/SDDbase_LDC.tar calibFiles/.",ldcName[iLDC].Data(),firstDDL,lastDDL);
    gSystem->Exec(command.Data());
    command.Form("scp %s:/dateSite/ldc-SDD-%02d-%02d-0/work/SDDinj_LDC.tar calibFiles/.",ldcName[iLDC].Data(),firstDDL,lastDDL);<commit_msg>Updated directory names on LDC in SDD calibration plotting macro (Mario Sitta)<commit_after>#if !defined(__CINT__) || defined(__MAKECINT__)
#include <TApplication.h>
#include <TGClient.h>
#include <TGButton.h>
#include <TGFrame.h>
#include <TGLayout.h>
#include <TGWindow.h>
#include <TGLabel.h>
#include <TGNumberEntry.h>
#include <TString.h>
#include <TCanvas.h>
#include <TStyle.h>
#include <TPad.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TF1.h>
#include <TSystem.h>
#include <TGraph.h>
#include <TLatex.h>
#include <TLine.h>
#include <TROOT.h>
#endif

// Macro to display the output of SDD calibration runs
// -> copies the ASCII files with the DA output from the LDC
// -> plot various histograms and graphs
// Origin: <NAME> (<EMAIL>)

class CheckCalibInterface : public TGMainFrame {

private:
  TGCompositeFrame    *fHor1;
  TGCompositeFrame    *fHor2;
  TGCompositeFrame    *fHor3;
  TGCompositeFrame    *fHor4;
  TGTextButton        *fCopyFiles;
  TGTextButton        *fShowPedest;
  TGTextButton        *fShowPulser;
  TGTextButton        *fShowInject;
  TGTextButton        *fShowOneMod;
  TGTextButton        *fExit;
  TGGroupFrame        *fGframeALL;
  TGGroupFrame        *fGframeSING;
  TGGroupFrame        *fGframe1;
  TGGroupFrame        *fGframe2;
  TGNumberEntry       *fDDL;
  TGNumberEntry       *fChannel;
  Int_t fNumDDL;
  Int_t fNumChannel;

public:
  CheckCalibInterface(const TGWindow *p, UInt_t w, UInt_t h);
  virtual ~CheckCalibInterface();
  void DoSetlabel();

  static void CopyFiles();
  static void ShowPedestal();
  static void ShowPulser();
  static void ShowInjector();
  static void ShowSingleModule(Int_t iddl, Int_t ichan);
  static void ClearAll();

  ClassDef(CheckCalibInterface, 0)
};
                          
CheckCalibInterface::CheckCalibInterface(const TGWindow *p, UInt_t w, UInt_t h)
   : TGMainFrame(p, w, h)
{

  fHor1 = new TGHorizontalFrame(this);
  fHor2 = new TGHorizontalFrame(this);
  fHor3 = new TGHorizontalFrame(this);
  fHor4 = new TGHorizontalFrame(this);

  TGLayoutHints *lh=new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
  TGLayoutHints *lhc=new TGLayoutHints(kLHintsCenterY | kLHintsExpandY, 5, 5, 5, 5);
  TGLayoutHints *lh1=new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5);

  fCopyFiles = new TGTextButton(fHor1, "&Copy Files", "CheckCalibInterface::CopyFiles()");
  fHor1->AddFrame(fCopyFiles, lh1);

  fGframeALL = new TGGroupFrame(fHor2,"All Modules",kHorizontalFrame);
  fShowPedest = new TGTextButton(fGframeALL, "&Show Pedestal","CheckCalibInterface::ShowPedestal()");
  fShowPulser = new TGTextButton(fGframeALL, "&Show Pulser","CheckCalibInterface::ShowPulser()");
  fShowInject = new TGTextButton(fGframeALL, "&Show Injector","CheckCalibInterface::ShowInjector()");    
  fGframeALL->AddFrame(fShowPedest, lh1);
  fGframeALL->AddFrame(fShowPulser, lh1);
  fGframeALL->AddFrame(fShowInject, lh1);
  fHor2->AddFrame(fGframeALL, lh1);

  fGframeSING = new TGGroupFrame(fHor3,"Single Module",kHorizontalFrame);
  fGframe1 = new TGGroupFrame(fGframeSING, "DDL");
  fDDL = new TGNumberEntry(fGframe1, 0, 2,-1, TGNumberFormat::kNESInteger,
			   TGNumberFormat::kNEANonNegative, 
			   TGNumberFormat::kNELLimitMinMax,
			   0, 23);
  fGframe2 = new TGGroupFrame(fGframeSING, "Channel");
  fChannel = new TGNumberEntry(fGframe2, 0, 2,-1, TGNumberFormat::kNESInteger,
			       TGNumberFormat::kNEANonNegative, 
			       TGNumberFormat::kNELLimitMinMax,
			       0, 11);
  fGframe1->AddFrame(fDDL,lh);
  fGframe2->AddFrame(fChannel,lh);
  fGframeSING->AddFrame(fGframe1,lh);
  fGframeSING->AddFrame(fGframe2,lh);
  
  fDDL->Connect("ValueSet(Long_t)", "CheckCalibInterface", this, "DoSetlabel()");
  (fDDL->GetNumberEntry())->Connect("ReturnPressed()", "CheckCalibInterface", this, "DoSetlabel()");
  
  fChannel->Connect("ValueSet(Long_t)", "CheckCalibInterface", this, "DoSetlabel()");
  (fChannel->GetNumberEntry())->Connect("ReturnPressed()", "CheckCalibInterface", this, "DoSetlabel()");
  fHor3->AddFrame(fGframeSING, lh1);
  
  fShowOneMod = new TGTextButton(fGframeSING, "&Show Selected Module","CheckCalibInterface::ShowSingleModule(0,0)");
  fGframeSING->AddFrame(fShowOneMod, lhc);

  fExit = new TGTextButton(fHor4, "&Exit", "gApplication->Terminate(0)");
  fHor4->AddFrame(fExit, lh1);

  AddFrame(fHor1,lh1);
  AddFrame(fHor2,lh1);
  AddFrame(fHor3,lh1);
  AddFrame(fHor4,lh1);

  SetCleanup(kDeepCleanup);
  SetWindowName("Main Control");
  MapSubwindows();
  Resize(GetDefaultSize());
  MapWindow();
}

CheckCalibInterface::~CheckCalibInterface()
{
   // Destructor.
   
   Cleanup();
}


void CheckCalibInterface::CopyFiles(){
  //
  // 8 LDCs in Run2 with new (simpler) dirs - M.S. 25 jul 14
  TString command;
  TString ldcName[8]={"aldaqpc009","aldaqpc010","aldaqpc011","aldaqpc012",
		      "aldaqpc013","aldaqpc014","aldaqpc015","aldaqpc016"};
  gSystem->Exec("rm -rf calibFiles");
  gSystem->Exec("mkdir calibFiles");
  for(Int_t iLDC=0; iLDC<8; iLDC++){
    Int_t firstDDL=iLDC*3;
    Int_t lastDDL=iLDC*3+2;
    command.Form("scp %s:/dateSite/ldc-SDD-%d/work/SDDbase_step2_LDC.tar calibFiles/.",ldcName[iLDC].Data(),iLDC);
    gSystem->Exec(command.Data());
    command.Form("scp %s:/dateSite/ldc-SDD-%d/work/SDDbase_LDC.tar calibFiles/.",ldcName[iLDC].Data(),iLDC);
    gSystem->Exec(command.Data());
    command.Form("scp %s:/dateSite/ldc-SDD-%d/work/SDDinj_LDC.tar calibFiles/.",ldcName[iLDC].Data(),iLDC);
{'fraction_non_alphanumeric': 0.14378418466672846, 'fraction_numerical': 0.020673032353759155, 'mean_word_length': 5.003338898163606, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 97, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2615030', 'n_tokens_mistral': 4413, 'n_tokens_neox': 4155, 'n_words': 706}