void Energy(TH1F *h, TTree *tree) {

  UInt_t w,z,MaxEntr;
  Float_t sum;
  
  MaxEntr = (UInt_t)(tree->GetEntries());
  cout << "MaxEntr " << MaxEntr << endl;
  for( z = 0 ; z < MaxEntr ; z++) {
    tree->GetEntry(z);
    sum=0;
    for(w=0; w<4224; w++) {
      if ((Enestrip[w] < 0.1) && (Enestrip[w] >= 0)) sum+=Enestrip[w];
    }
    h->Fill(sum);
  }
  cout << z << " events processed" << endl;
  cout << "Finished" << endl;
}


